1
0
Fork 0
forked from wezm/wezm.net

Link archive pages together with a simple menu

This commit is contained in:
Wesley Moore 2010-01-30 17:42:29 +11:00
parent db6fe5638c
commit 0aea6dae4b
2 changed files with 16 additions and 3 deletions

View file

@ -10,10 +10,20 @@
<div id="content"> <div id="content">
<h1>Archives</h1> <h1>Archives</h1>
<%
menu = [
['All', sorted_articles.size],
['Technical', technical_articles.size],
['Personal', personal_articles.size],
]
%>
<ul class="inline"> <ul class="inline">
<li><a href="/articles/">All</a> (<%= sorted_articles.size %>)</li> <% menu.each do |menu_item|
<li><a href="/technical/articles/">Technical</a> (<%= technical_articles.size %>)</li> label, count = menu_item
<li><a href="/personal/articles/">Personal</a> (<%= personal_articles.size %>)</li> path = (label != "All" ? '/' + label.downcase : '') + "/articles/"
%>
<li><a href="<%= path %>"<%= %Q{class="active"} if @item.identifier == path %>><%= label %></a> (<%= count %>)</li>
<% end %>
</ul> </ul>
<ul class="articles"> <ul class="articles">

View file

@ -192,6 +192,9 @@ ul.articles strong {
a.more { a.more {
/* float: right;*/ /* float: right;*/
} }
a.active {
font-weight: bold;
}
/* Inline flat list style */ /* Inline flat list style */
ul.inline { ul.inline {