2011-03-10 41 views
1

,我想我的index.html指向特定的佈局,使我創建的佈局,它被稱爲nosidebar.htmlNanoc佈局編譯我與nanoc工作規則

我的規則是這樣的:

compile 'index.html' do 
    layout 'nosidebar' 
end 

這似乎並不奏效。我究竟做錯了什麼?

回答

1

我還沒有確切做了你是誰,也許是這樣的:

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

感謝您的幫助。但這並不奏效。 – 2011-03-10 22:19:53

+0

一旦你理解了規則,它就可以工作。 – 2011-03-13 00:38:34

11

您可以隨時添加類似:

compile '*' do 
    if item.binary? 
    # don’t filter binary items 
    else 
    layout item[:layout] || 'default' 
    end 
end 

這意味着你可以決定的模板文件加入:

--- 
layout: nosidebar 
--- 

在yaml文件的前端事項。