1
0
Fork 0
mirror of https://github.com/fmap/muflax65ngodyewp.onion synced 2024-07-01 10:46:49 +02:00
muflax65ngodyewp.onion/layouts/next-prev.erb

27 lines
700 B
Plaintext
Raw Normal View History

<% if @item.article? %>
<div id="next_prev">
<p>
<% items = @site.items_by_date @category
index = items.index(@item)
next_item = items[index + 1]
prev_item = index > 0 ? items[index - 1] : nil %>
<% unless prev_item.nil? %>
<span class="align_left">
<a class='next_prev' href='<%= prev_item.path %>'>
<%= prev_item[:title] %>
</a>
</span>
<% end %>
<% unless next_item.nil? %>
<span class="align_right">
<a class='next_prev' href='<%= next_item.path %>'>
<%= next_item[:title] %>
</a>
</span>
<% end %>
</p>
</div>
<% end %>