On Github Takazudo / presentation-assemble
├── Gruntfile.coffee
├── config.yml
├── package.json
├── pagesrc
│ └── 1.hbs
└── result
└── 1.html
module.exports = (grunt) ->
grunt.task.loadNpmTasks 'assemble'
grunt.initConfig
assemble:
pages:
options:
data: ['config.yml']
files: [
{
src: 'pagesrc/1.hbs'
dest: 'result/1.html'
}
]
grunt.registerTask 'default', ['assemble']
My name is {{ config.name }}.
name: Takazudo
$ grunt
My name is Takazudo.
├── Gruntfile.coffee
├── config.yml
├── package.json
├── pagesrc
│ └── 1.hbs
├── partials
│ └── products.hbs
└── result
└── 1.html
module.exports = (grunt) ->
grunt.task.loadNpmTasks 'assemble'
grunt.initConfig
assemble:
options:
partials: 'partials/*.hbs'
pages:
options:
data: ['config.yml']
files: [
{
src: 'pagesrc/1.hbs'
dest: 'result/1.html'
}
]
grunt.registerTask 'default', ['assemble']
---
title: hogehogeTitle
description: This page is cool!
---
This page's title is {{ title }}.
{{ description }}
My name is {{ config.name }}.
{{> products }}
name: Takazudo
products:
- name: gyudon
price: 200
- name: katsudon
price: 300
{{#each config.products}}
- {{ name }} is {{ price }} yen
{{/each}}
$ grunt
This page's title is hogehogeTitle. This page is cool! My name is Takazudo. - gyudon is 200 yen - katsudon is 300 yen