List body content of all pages

Hi all!

Is something like this possible (body causes the problem):


<ul>
<% current_page.siblings.select { |p| p.ext == ".html" && p.data.title }.each do |page| %>
  <li><%= page.body %></li>
<% end %>
</ul>

Thank you very much!

Hi,

Try this:

<ul>
<% sitemap.resources.find_all { |r| r.path == '.html' && r.data.title }.each do |page| %>
<li><%= page.body %></li>
<% end %>
</ul>

Thanks a lot!

Unfortunately, it is not working. The result for page.body is empty—even for page.data.title.

Any other ideas?

I had success with this gist. Maybe, there is a simpler solution. But this solved my problem.

Actually, I forgot to verify our versions of Middleman. I use v4.0.0.rc.1. Perhaps it wasn’t working the same way in previous versions of Middleman.

O true. I did not think of that. I’m on MM 3.4.0, but I’ll switch to version 4 short and try your Code then.

Thanks a lot!