Closed mmilano closed 7 years ago
The purpose of the debug
flag is to give a quick glimpse into the state of Handlebars when a file is rendered. This can be useful to tell if a glob pattern has converted into the state you expect to be there when writing your templates.
debug
The debug flag can be a Boolean or a Number:
0
and false
are equivalent1
and true
are equivalent2
will output the same as 1
and true
plus glob-matching debug information. Very noisy, rarely needed, but there if you want it.When the debug flag is not 0
or false
, gulp-hb
will log the top-level object keys (like your example) for pertinent internal Handlebars objects where the list is the result of running Object.keys(handlebars[property])
:
global data
Top-level object keys of data that was registered using hb({ data: ... })
or the .data()
method. Gives you a sense of what you can access at the root-level of your templates using {{foo}}
or {{@global.foo}}
. In your case you'd be able to access {{site}}
, {{@global.sitePortfolio}}
, etc.
local data
Top-level object keys of data passed into the template at render time. This will be the file.data
property if it exists. Gives you a sense of what you can access at the local-level of your templates using {{foo}}
or {{@local.foo}}
. In your case, you haven't used a plugin to populate the file.data
property.
decorators
, helpers
, and partials
Top-level object keys of Handlebars registries. Same as Object.keys(handlebars.partials)
to list registered partials for example. The blockHelperMissing
and helperMissing
helpers are not errors, but are default internal Handlebars helpers.
The handlebars-layouts
module is separate, though, as the author, I often include it. :)
thank you!
Of course!
hi, trying and struggling to use gulp-hb and your associated handlebars-layout (hb-layout?). w/r/t gulp-hb, can you add more clarification and detail to what the debug parameter will do, and what the contents of the various out sections should display?
in particular:
thanks.
right now, a run will give me something like this: