next/prev links in header
parent
fa00c1ea82
commit
485baa492a
|
@ -13,7 +13,7 @@
|
|||
<%= render 'list-item', :item => i, :episteme => false %>
|
||||
<% end %>
|
||||
<% if size > num %>
|
||||
<li>...(<%= size - num %> more)...</li>
|
||||
<li>...<%= size - num %> more...</li>
|
||||
<% end %>
|
||||
<% items.reverse.slice(0, num/2).reverse.each do |i| %>
|
||||
<%= render 'list-item', :item => i, :episteme => false %>
|
||||
|
|
|
@ -6,6 +6,9 @@
|
|||
<link rel="stylesheet" type="text/css" href="/styles/default.css"/>
|
||||
<meta name="generator" content="nanoc"/>
|
||||
<link rel="alternate" href="/rss.xml" type="application/rss+xml" title="<%= @site.title %>"/>
|
||||
|
||||
<% unless @site.before(@item).nil? %><link rel="prev" href="<%= @site.before(@item).path %>"/><% end %>
|
||||
<% unless @site.after(@item).nil? %><link rel="next" href="<%= @site.after(@item).path %>"/><% end %>
|
||||
<!-- google analytics -->
|
||||
<script type="text/javascript">
|
||||
var _gaq = _gaq || [];
|
||||
|
|
|
@ -145,6 +145,26 @@ class Nanoc::Site
|
|||
def latest_category? cat
|
||||
latest_article.category == cat unless latest_article.nil?
|
||||
end
|
||||
|
||||
def before item
|
||||
items = items_by_date
|
||||
index = items.index(item)
|
||||
if index.nil? or index.zero? or not blog?
|
||||
nil
|
||||
else
|
||||
items[index - 1]
|
||||
end
|
||||
end
|
||||
|
||||
def after item
|
||||
items = items_by_date
|
||||
index = items.index(item)
|
||||
if index.nil? or not blog?
|
||||
nil
|
||||
else
|
||||
items[index + 1]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def category name_or_cat
|
||||
|
|
Loading…
Reference in New Issue