2

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?

Noah Clark
  • 8,101
  • 14
  • 74
  • 116

2 Answers2

11

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.

Phrozen
  • 559
  • 4
  • 13
1

I haven't done exactly what you are but maybe something like this:

compile '/' do 
  rep.layout 'nosidebar'
end
Eran
  • 387,369
  • 54
  • 702
  • 768
ddoc
  • 26
  • 1