I’m trying to create a breadcrumb that will link to the parent index page. After searching, it seems that
(edit: 4 spaces so this would show up and have code styling. need text here or edit will not save…)
<%= current_page.parent.path %>
may get me what I want from the traversal extension. I would like this to return the parent link and parent title if possible.
It seems like the traversal extension may depend on sitemap, so I tried putting this in my config.rb
activate :sitemap
activate :traversal
but that didn’t work.
I have a partial example of what I want by placing the following code in my layout.erb file
<ul class="breadcrumb">
<li><%= link_to 'Home', '/' %></li><span> ></span>
<li><%= link_to 'Back', 'index.html' %></li>
</ul>
But this doesn’t help with the parent pages title.
Unfortunately I’m new to middleman and ruby and cant figure how to implement this for my site.
My setup
- Windows 8 x64
- Ruby 1.9.3 latest
- Middleman 3.2.2
- Basic middleman implementation with a custom template defined by a source folder and config.rb file