问题
I'm working with nanoc and I want my index.html to point to specific layout so I created that layout and it is called nosidebar.html
My Rules looks like:
compile 'index.html' do
layout 'nosidebar'
end
and this doesn't seem to work. What am I doing wrong?
回答1:
I haven't done exactly what you are but maybe something like this:
compile '/' do
rep.layout 'nosidebar'
end
回答2:
You can always add something like:
compile '*' do
if item.binary?
# don’t filter binary items
else
layout item[:layout] || 'default'
end
end
That means you can just decide the template on the file by adding:
---
layout: nosidebar
---
at the yaml front matter of the file.
来源:https://stackoverflow.com/questions/5254834/nanoc-layout-compile-rules