assemble / assemble.io

Website and documentation for Assemble.

Home Page:http://assemble.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

use built-in variables

erredeco opened this issue · comments

Hi I am trying to switch from grunt-assemble to assemble (+gulp);

I am using assemble 0.24.3

My current problem: the built-in variables http://assemble.io/docs/Built-in-Variables.html are not working on both templates and partials, for example:

{{pagename}}

returns nothing, while {{basename}} throws an error:

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)

By the way

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

has been added to the index.html template file , not to seminars.html (??)
Am I missing something?

@erredeco Thanks for the issue! If you're reporting a bug, please be sure to include:

  • The version of assemble you are using.
  • Your assemblefile.js (This can be in a gist)
  • The commandline output. (Screenshot or gist is fine)
  • What you expected to happen instead.

Hi @erredeco, the docs at assemble.io were originally created for grunt-assemble. The API and built-in variables have changed since then. For now, I would look at the READMEs for assemble and templates for what the current API looks like. There is also work being done to make the API easier to understand and to use recipes to show how things (like using those built-in variables) can be done in different scenarios.

If you could, please create a question on StackOverflow and tag it with assemble. Also, show some more information about your project. A link to a respository with the assemblefile.js would really be helpful. You can also post an issue in the assemble repository with a link to your StackOverflow question to get more eyes on it. Someone else may have already run across this issue while migrating and will be able to help.

I'm going to close this here.