I’m guessing this is possible but I’m a bit of a noob with Ruby. I have a bunch of html pages and I want to create next/links on each page to link to the next/page in the sitemap hierarchy based on their url. I’m currently listing all the pages as so…
<% pages = sitemap.resources.find_all{|p| p.source_file.match(/.html/)}.sort_by {|p| p.url} %>
-
<% pages.each do |p| %>
<% if(p.data.title) %>
- <%= link_to p.data.title, p.url %> <% end %> <% end %>
But how do I find the next/prev page from that list when I’m on the current page to create a simple navigation?