我正在使用 Wintersmith 以及wintersmith-stylus和wintersmith-jade插件制作一个静态网站。
我想在帮助页面中添加一个特定的 CSS 文件。帮助页面基于“布局”模板。当我尝试使用块将样式表插入 html 头部时,我收到以下错误:
Line ##: Unexpected identifier
布局.jade
doctype html
html
head
block head
link(rel="stylesheet" href="/styles/layout.css")
body
...
帮助.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
...
即使我将extends
和移动到block head
包含 的元数据块的顶部template: layout.jade
,我仍然会收到相同的错误。在我的情况下,删除extends ./layout.jade
导致错误线位置从 40 移动到 5。
我的猜测是该错误是由 wintersmith-jade 插件引起的,但即使是这种情况,我也不知道如何修复它。