mirror of
https://github.com/wezm/wezm.net.git
synced 2024-11-10 01:42:32 +00:00
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
|
||||
|
||||
compile '/articles/' do
|
||||
filter :erb
|
||||
layout 'articles'
|
||||
end
|
||||
compile '/technical/articles/' do
|
||||
filter :erb
|
||||
layout 'articles'
|
||||
end
|
||||
compile '/personal/articles/' do
|
||||
filter :erb
|
||||
layout 'articles'
|
||||
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
|
||||
body_class: articles
|
||||
title: All Articles
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<% sorted_articles[0..9].each do |article| %>
|
||||
<% personal_articles[0..9].each do |article| %>
|
||||
<%= render 'article', :article => article %>
|
||||
<% end %>
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<% sorted_articles[0..9].each do |article| %>
|
||||
<% technical_articles[0..9].each do |article| %>
|
||||
<%= render 'article', :article => article %>
|
||||
<% end %>
|
||||
|
|
|
@ -8,11 +8,18 @@
|
|||
<body class="articles">
|
||||
<%= render 'header' %>
|
||||
<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">
|
||||
<%= yield %>
|
||||
</ul>
|
||||
|
||||
|
||||
<div class="pagination">
|
||||
<a href="#page-0" class="older">« Older</a>
|
||||
|
|
||||
|
|
Loading…
Reference in a new issue