templateDatavariables返回未定义的帮助函数(docpad.coffeeconfiguration文件)

这是我的configuration文件 。

docpadConfig = { templateData: site: title: 'hello docpad' getTitle: -> @site.title getString: -> 'just a string' } # Export the DocPad Configuration module.exports = docpadConfig 

当我做title= site.title时候,从一个玉石的布局,它呈现的确定。 当我尝试调用helper函数title= getTitle() ,控制台输出:

 error: An error occured: ReferenceError: /Volumes/Data/project/am/lab/docpad/hello_docpad/src/layouts/default.html.jade:21 19| 20| //- Our site title and description > 21| title= getTitle() 22| 23| //- Output DocPad produced meta elements 24| != getBlock('meta').toHTML() site is not defined at docpadConfig.templateData.getWat (/Volumes/Data/project/am/lab/docpad/hello_docpad/docpad.coffee:10:16) at eval (eval at <anonymous> (/Volumes/Data/project/am/lab/docpad/hello_docpad/node_modules/docpad-plugin-jade/node_modules/jade/lib/jade.js:170:8), <anonymous>:47:64) 

看起来我不能从辅助函数内访问站点对象。

我敢肯定,我错过了一些微不足道的东西,也许这是一个插件需要…不能找出“笏”在这里是错误的。

我发现解决scheme在docpad骨架中寻找类似的问题。 这与Jade预处理器中的一个错误有关。

更新到"docpad-plugin-jade": "~2.4.1"修复了这个问题。