2014-09-27 21 views
3

我正在使用Wintersmith沿着wintersmith-styluswintersmith-jade插件靜態網站。「意外標識符」當添加擴展/塊wintersmith玉內容文件

我想補充一個特定的CSS文件中的一個幫助頁面。幫助頁面基於「佈局」模板。當我嘗試使用塊樣式表插入到HTML頭,我收到以下錯誤:

Line ##: Unexpected identifier 

layout.jade

doctype html 
html 
    head 
     block head 
     link(rel="stylesheet" href="/styles/layout.css") 
    body 

... 

help.jade

--- 
template: layout.jade 
--- 

//- Error inducing code 
extends ./layout.jade 

block head 
    link(rel="stylesheet" type="text/css" href="../styles/help.css") 
//- end of error inducing code 

... 

即使我移動extendsblock head線的元之上數據塊包含template: layout.jade,我仍然收到相同的錯誤。在我的情況下,刪除extends ./layout.jade導致錯誤行位置從40移動到5。

我的猜測是錯誤是由wintersmith玉插件引起的,但即使是我失去了我如何去修復它的情況。

回答

2

由於我想同時使用Stylus和Jade(將Jade用於內容和模板),我最終轉向Harp。豎琴不僅有Stylus和Jade「內置」,而且比Wintersmith稍微簡單一些。

這是一個很好的解決方法,但我會說它實際上是同時升級。

0

我沒有使用wintersmith-jade,但它看起來像那個插件不應該影響/templates(這是我認爲你指的是)的常規模板。

看着templates/article.jade,看起來你應該只使用extends layout而不是extends ./layout.jade

默認模板還沒有元數據塊,但也許對於您所使用的插件是必要的。

+0

對不起,我應該指定'layout.jade'確實位於'/ templates'中,而'help.jade'是一塊使用wintersmith-jade變得可能的'content'。 – AquaGeneral 2014-09-28 23:50:18

+0

下面是這兩個文件的位置: layout.jade:templates/layout.jade help.jade:contents/help/index.jade 我試過你的建議,但不幸的是沒有修復它 - 甚至沒有發生錯誤行改變了。 我只注意到,如果我刪除元數據塊,錯誤與原來一模一樣 - 這是相當奇怪的。 – AquaGeneral 2014-09-28 23:58:40