assemble.io和gulp一些内置变量不起作用

时间:2019-01-10 08:29:29

标签: gulp handlebars.js partials assemble

嗨,我正在尝试从咕unt声组装转换为组装(与gulp配对);我正在使用汇编0.24.3

我当前的问题:某些内置变量http://assemble.io/docs/Built-in-Variables.html在页面和部分页面上均无效,例如:

{{pagename}}

不返回任何内容,而{{basename}}则引发错误:

Message:
    utils.expectedType is not a function
Details:
    helper: [object Object]
    fileName: C:\Progetti\myproject\source\Templates\pages\seminars.html
    files: [object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
    view: [object Object]
    domainEmitter: [object Object]
    domain: [object Object]
    domainThrown: false

Stack:
TypeError: utils.expectedType is not a function
    at Object.helpers.basename (C:\Progetti\myproject\node_modules\handlebars-helpers\lib\path.js:83:31)
    at Object.<anonymous> (C:\Progetti\myproject\node_modules\deep-bind\index.js:61:15)
    at C:\Progetti\myproject\node_modules\async-helpers\index.js:331:23
    at C:\Progetti\myproject\node_modules\co\index.js:136:8
    at new Promise (<anonymous>)
    at thunkToPromise (C:\Progetti\myproject\node_modules\co\index.js:135:10)
    at toPromise (C:\Progetti\myproject\node_modules\co\index.js:119:55)
    at next (C:\Progetti\myproject\node_modules\co\index.js:99:29)
    at onFulfilled (C:\Progetti\myproject\node_modules\co\index.js:69:7)
    at process.internalTickCallback (internal/process/next_tick.js:77:7)

顺便

<h1>{{basename}}</h1>

已添加到index.html页面文件,而不是workshops.html(??)

我错过了什么还是做错了什么?

[编辑]

我还必须补充一点,我也在使用把手帮助程序(版本0.10.0)

1 个答案:

答案 0 :(得分:0)

我自己找到了答案:只需使用:

{{basename path}}