Hello everyone,
I have a long page in Markdown that I want to split up into
several .md files and would like nanoc to reassemble/compile all these
into a single .html file. I have the 'default' layout and a partial
layout called 'listitem'. At the root of the article, the .md loads
all compiled children into itself for rendering. The interesting part
is that, every individually rendered part is correctly generated with
the list item layout but when gathered into a single .html page, part
of the formatting in the partial layout is lost :(
The site is my own personal one:
http://www.keltia.net/ so it is very
easy to see the result.
All code is at
http://bitbucket.org/keltia/keltia.net (or
http://assets.keltia.net/keltia.tar.xz) but the interesting parts are:
filesystem:
-=-=-
content/about:
cameras/
cameras.md
content/about/cameras:
part1.md
part10.md
part11.md
part12.md
part2.md
part3.md
part4.md
part5.md
part6.md
part7.md
part8.md
part9.md
-=-=-
cameras.md:
-=-=-
---
title: My [long] list of cameras overtime
short_name: List of cameras
image: pentax-k-5.png
is_dynamic: true
---
## <%= @item[:title] %>
Here is a rather long history of my cameras and lenses...
<% @item.children.sort_by{|i| i[:slug].to_i}.each do |item| %>
<%= item.compiled_content %>
<% end %>
-=-=-
layout/listitem.html
-=-=-
<h3><%= @item[:title] %></h3>
<div class="left">
<img src="
http://assets.keltia.net/images/<%= @item[:image] %>"
alt="<%= @item[:alt] %>" width="70"/>
</div>
<div class="main">
<%= yield %>
</div>
-=-=-
Expected result:
-=-=-
[...]
<h3>At the beginning</h3>
<div class="left">
<img src="
http://assets.keltia.net/images/600si.png" alt="Minolta
600si Classic" width="70"/>
</div>
<div class="main">
<p>At the beginning, I had no camera on my own [...]
-=-=-
but in the final output/about/cameras/index.html there is only this,
layout seems to be lost. Why item.compiled_content empty??
-=-=-
<p>At the beginning, I had no camera on my own, [...]
-=-=-
Any idea? Thanks to bobthecow and darix who tried to help me on the
IRC channel :)