grunt-assemble

grunt assemble multiple files from one datafile

爷,独闯天下 提交于 2019-12-13 19:44:12
问题 I am trying to assemble multiple files using one template and one data file data.json { "site": { "title": "A Blog", "author": "Jon Schlinkert" }, "pages": [ { "metadata": { "title": "Blog Post #1", "summary": "", "categories": [""], "layout": "post.hbs", "gists": ["5898072"] }, "content": "This would get passed into the `body` tag, but it's not necessary if you only need to add a post from a gist." }, { "metadata": { "title": "Blog Post #2", "summary": "", "categories": [""], "layout": "post

Register Assemble Handlebars Helpers

情到浓时终转凉″ 提交于 2019-12-12 12:52:35
问题 I am trying to do something that seems relatively simple from the Assemble docs and other repos I've looked at but for some reason I'm having a problem registering my Handlebars helpers. The helper is in helpers > helper-classgrid.js module.exports.register = function (Handlebars, options, params) { Handlebars.register('classgrid', function (index, options) { gridclass: function (index, options) { if (index === 0 || index % 4 === 0) { return options.fn(this); } return options.inverse(this); }

Paths of the generated pages with assemble

那年仲夏 提交于 2019-11-29 14:16:37
问题 I am struggling with the grunt-assemble grunt task configuration which looks like this: assemble: { options: { flatten: false, expand: true, assets: '', layout: 'default.hbs', layoutdir: 'templates/layouts', partials: ['templates/includes/*.hbs'], helpers: ['templates/helpers/*.js'], data: ['templates/data/*.{json,yml}'] }, dev: { src: 'templates/pages/**/*.hbs', dest: 'build/' } The scaffolding of the project templates for assemble.io looks like: templates ├── helpers ├── includes │ ├── page