Noah Clark
Noah Clark

Reputation: 8131

Nanoc layout compile Rules

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?

Upvotes: 2

Views: 859

Answers (2)

ddoc
ddoc

Reputation: 26

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

compile '/' do 
  rep.layout 'nosidebar'
end

Upvotes: 1

Phrozen
Phrozen

Reputation: 559

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.

Upvotes: 11

Related Questions