forked from wezm/wezm.net
Implement archive pages
This commit is contained in:
parent
b9489b7f62
commit
db6fe5638c
6 changed files with 26 additions and 6 deletions
3
Rules
3
Rules
|
@ -15,12 +15,15 @@ compile '/personal/articles/json/' do
|
||||||
end
|
end
|
||||||
|
|
||||||
compile '/articles/' do
|
compile '/articles/' do
|
||||||
|
filter :erb
|
||||||
layout 'articles'
|
layout 'articles'
|
||||||
end
|
end
|
||||||
compile '/technical/articles/' do
|
compile '/technical/articles/' do
|
||||||
|
filter :erb
|
||||||
layout 'articles'
|
layout 'articles'
|
||||||
end
|
end
|
||||||
compile '/personal/articles/' do
|
compile '/personal/articles/' do
|
||||||
|
filter :erb
|
||||||
layout 'articles'
|
layout 'articles'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
11
content/articles.html
Normal file
11
content/articles.html
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<ul class="articles">
|
||||||
|
<% sorted_articles[0..9].each do |article| %>
|
||||||
|
<%= render 'article', :article => article %>
|
||||||
|
<% end %>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="pagination">
|
||||||
|
<a href="/articles/#page-0" class="older">« Older</a>
|
||||||
|
|
|
||||||
|
<a href="/articles/#page-2" class="newer">Newer »</a>
|
||||||
|
</div>
|
|
@ -1,3 +1,2 @@
|
||||||
---
|
---
|
||||||
title: Articles
|
title: All Articles
|
||||||
body_class: articles
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
<% sorted_articles[0..9].each do |article| %>
|
<% personal_articles[0..9].each do |article| %>
|
||||||
<%= render 'article', :article => article %>
|
<%= render 'article', :article => article %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
<% sorted_articles[0..9].each do |article| %>
|
<% technical_articles[0..9].each do |article| %>
|
||||||
<%= render 'article', :article => article %>
|
<%= render 'article', :article => article %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -8,7 +8,14 @@
|
||||||
<body class="articles">
|
<body class="articles">
|
||||||
<%= render 'header' %>
|
<%= render 'header' %>
|
||||||
<div id="content">
|
<div id="content">
|
||||||
<h1><%= @item[:title] %></h1>
|
<h1>Archives</h1>
|
||||||
|
|
||||||
|
<ul class="inline">
|
||||||
|
<li><a href="/articles/">All</a> (<%= sorted_articles.size %>)</li>
|
||||||
|
<li><a href="/technical/articles/">Technical</a> (<%= technical_articles.size %>)</li>
|
||||||
|
<li><a href="/personal/articles/">Personal</a> (<%= personal_articles.size %>)</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<ul class="articles">
|
<ul class="articles">
|
||||||
<%= yield %>
|
<%= yield %>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
Loading…
Reference in a new issue