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

问题描述 投票:0回答:1

嗨,我正在尝试从grunt-assemble切换到汇编(与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页面文件中,而不是添加到seminars.html(??)

我错过了什么或做错了什么?

[编辑]

我必须补充说我也在使用把手 - 助手(版本0.10.0)

gulp handlebars.js partials assemble
1个回答
0
投票

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

{{basename path}}
© www.soinside.com 2019 - 2024. All rights reserved.