assemble

How to use Handlebars ternary helper?

梦想与她 提交于 2019-12-09 09:21:01
问题 Following this answer, I wrote a helper like module.exports.register = function (Handlebars) { Handlebars.registerHelper('ternary', function(test, yes, no) { return test ? yes : no; }); }; I'm certain that the helper is loaded and being defined but can't figure out the syntax to use it. I tried using it like <div>{{ternary(true, 'yes', 'no')}}</div> but that gives an assemble build error Warning: Parse error on line 10: ...<div>{{ternary(true, 'yes', ----------^ Expecting 'ID', 'DATA', got

How to include workspace artifacts in the assembly using Appassembler maven plug-in?

拈花ヽ惹草 提交于 2019-12-08 13:50:38
问题 I'm using Eclipse m2e in my development environment, and I have a spring-boot maven project(can be viewed as a standard maven jar project with runnable main class in this context) which depends on another maven project in the same workspace(workspace artifact, let's call it moduleB, a sibling of the spring-boot project), when I run the maven goal clean package (the appassembler:assemble goal can be ommited because I configured the execution section of the plugin, see the configuration detail

How can I generate multiple pages from a JSON file with Assemble

房东的猫 提交于 2019-12-07 12:00:48
问题 So I'm building a framework for reproduceable articles. Each article will be composed of a combination of 'sections' which basically constitute an html block and some associated content. For example a given article may be composed as follows: author section text section image section text section blockquote section carousel section text section I'm imagining there's a partial template for each section, and as mentioned the sections will have associated data, so for a text section it might

Assemble: How can I generate pages from json/yaml?

纵饮孤独 提交于 2019-12-06 03:32:05
Is there a way to generate pages from json/yaml if you provide a layout? I thought this was possible, but can't find in docs. This is currently being tracked here in GitHub: http://webb.li/QjTX Since the options.pages feature has been implemented, you can add pages like this: options: { pages: { "about": { "data": { "title": "About" }, "content": "Content for {{title}}" }, ... } } We aren't supporting automatic loading of a json/yml file, but you can do this inside your Gruntfile and add the object to options.pages that way... module.exports = function(grunt) { grunt.initConfig({ // package

How to use Handlebars ternary helper?

对着背影说爱祢 提交于 2019-12-04 02:31:14
Following this answer , I wrote a helper like module.exports.register = function (Handlebars) { Handlebars.registerHelper('ternary', function(test, yes, no) { return test ? yes : no; }); }; I'm certain that the helper is loaded and being defined but can't figure out the syntax to use it. I tried using it like <div>{{ternary(true, 'yes', 'no')}}</div> but that gives an assemble build error Warning: Parse error on line 10: ...<div>{{ternary(true, 'yes', ----------^ Expecting 'ID', 'DATA', got 'INVALID' Use --force to continue. What is the proper syntax to use a helper like that? Handlebars

Assemble: Multiple points of content insertion in layout?

别说谁变了你拦得住时间么 提交于 2019-12-03 03:42:51
All assemble users who uses layouts knows that "{{> body }}" marks the point of insertion of contents of any page who uses the layout. But is it possible to define multiple points of insertions, instead of tossing everything at where the {{> body }} is? For instance, in my page I would like to define a specific piece of javascript, but I like that custom javascript to be at the very bottom of the page along with out javascript tags. If it only puts everything where the {{> body }} is, this is not possible, since the script will just be appended to the content. In other words, it would be

How should I configure grunt-usemin to work with relative path

杀马特。学长 韩版系。学妹 提交于 2019-12-02 16:20:06
I have a grunt project backed by a yeoman-generator that I've built based on the generator-webapp , if it's of any help, you can find it on GitHub The grunt project makes us of the grunt-usemin task. My project involve building a multilingual website, and to keep things clean, I've decided to put all the pages written in a language in a folder name after the 2-letter shortcode of the said language. | project/ |--dist/ |----en/ |------index.html |------404.html |------... |----fr/ |------index.html |------404.html |------... The files are made from handlebars templates and processed with

Using Assemble, generate HTML files from multiple data files using one template file?

六眼飞鱼酱① 提交于 2019-11-30 07:16:16
问题 I am trying to use Assemble to generate multiple static files from multiple data files using one template. In more detail, I have 12 JSON files representing the data for cooking recipes, and one Handlebars file, recipe.hbs, with a layout file of default.hbs. I want to output an HTML file based on each of those JSON files. File Structure: /templates /data recipe1.json recipe2.json, etc. /layouts default.hbs /pages recipe.hbs Output: /output recipe1.html (based on recipe1.json) recipe2.html

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

Using Assemble, generate HTML files from multiple data files using one template file?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-29 02:42:33
I am trying to use Assemble to generate multiple static files from multiple data files using one template. In more detail, I have 12 JSON files representing the data for cooking recipes, and one Handlebars file, recipe.hbs, with a layout file of default.hbs. I want to output an HTML file based on each of those JSON files. File Structure: /templates /data recipe1.json recipe2.json, etc. /layouts default.hbs /pages recipe.hbs Output: /output recipe1.html (based on recipe1.json) recipe2.html (based on recipe2.json), etc. It sounds like this should be possible using collections, but I can't seem