assemble

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

眉间皱痕 提交于 2019-12-20 08:38:33
问题 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

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

gulp-assemble & gulp-watch not recompiling site when changes are made to data, includes or layouts

浪子不回头ぞ 提交于 2019-12-13 00:27:54
问题 I'm having issues using gulp-assemble with gulp-watch . I want gulp to watch the entire assemble source directory ( data , includes , layouts and pages ) and recompile the site when ever a file changes. I'm able to get this working correctly for pages , but gulp is not recompiling the site when changes are made to the data , includes or layouts files. I've added a watch task to the example gulpfile.js in the gulp-assemble repository: var gulp = require('gulp'); var htmlmin = require('gulp

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); }

How to include Partials defined in YMF (Assemble.io / Handlebars.js)

柔情痞子 提交于 2019-12-11 12:58:09
问题 I use assemble.io to generate some static files for a simple webpage. Now i would like to define a list of partials in YAML Front Matter that should be included in the generated page. I want this <div class="slides"> {{>slide-intro}} {{>slide-welcome}} {{>slide-goodbye}} </div> to be replaced by something like this: --- slides: - slide-intro - slide-welcome - slide-goodbye --- <div class="slides"> {{#each slides}} {{>this}} {{/each}} </div> So, I want to use the variable content stored in

Passing content to nested partials in assemble

走远了吗. 提交于 2019-12-11 10:28:01
问题 I'm using assemble for prototyping a new site. I would like to modularize my code quite drastically, much like Brad Frost is evangelizing with his pattern lab. EXAMPLE Basically I would like to have a title partial ("atom" in pattern-lab speak) which is used inside a hero partial ("molecule"): title.hbs <h1 class="{{class}}">{{text}}</h1> hero.hbs <section class="hero-unit"> {{!-- image and stuff --}} <header class="hero-description"> {{> title }} {{> subTitle }} </header> </section> The hero

assemble.io - context of yaml data in partials not working

泄露秘密 提交于 2019-12-11 09:29:40
问题 I have an issue with YAML rendering content within partials using Assemble Here is my breakdown: layout/deafualt.hbs <body> {{pagetitle}} <!-- THIS WILL RENDER 'HELLO WORLD' FINE --> <header role="banner"> {{> _header }} </header> <main role="main"> {{> body }} </main> <footer role="contentinfo"> {{> _footer }} </footer> </body> pages/car.hbs --- pagetitle: "HELLO WORLD" --- {{#car }} {{> banner }} {{> content }} {{> explore }} {{> feature }} {{> social }} {{/car }} modules/content.hbs <h1>{

How to Register custom handelbars helper in assemble 0.17.1

不打扰是莪最后的温柔 提交于 2019-12-11 05:52:09
问题 In my assemblefile.js I try to register a custom helper. The helper itself does work since i have it in use in a grunt project with assemble. assemble: { options: { helpers: ['./src/helper/custom-helper.js' ] } } In assemble 0.17.1 I tried it like this but it doesn´t work. Does anyone know how to do this? app.helpers('./src/helper/custom-helper.js'); custom-helper.js: module.exports.register = function (Handlebars, options, params) { Handlebars.registerHelper('section', function(name, options

How do I identify the current page in a page collection?

核能气质少年 提交于 2019-12-11 02:05:25
问题 I'm configuring a static site generator using Grunt's Assemble.io. I'm using the Pages Collection to build a navigation list like so: {{#each pages }} <li><a href="{{{filename}} }">{{{title}} }</a></li> {{/each }} I would also like to apply class="active" to the navigation item for the current page, but I'm not sure how to approach this. My first thought was to try comparing the title of the current iteration of the collection to that of the page being rendered, but this has two problems: The

Nested layout variables

无人久伴 提交于 2019-12-10 19:20:02
问题 Is there a way to access YFM properties defined in a child layout in its parent layout? For example, given a child layout page.hbs: --- layout: wrapper.hbs no_header: true ---- <div class="wrapper">{{> body }}</div> I'd like to access the no_header YFM property defined in page.hbs in the parent layout wrapper.hbs: <html> <body> {{#unless layout.no_header}}<header></header>{{/if}} {{> body }} </body> </html> 回答1: The front matter merges up so you should be able to get it on the root of the