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-footer.hbs
│ ├── page-header.hbs
│ └── scripts.hbs
├── layouts
│ └── default.hbs
└── pages
├── en
│ └── index.hbs
├── fr
│ └── index.hbs
└── index.hbs
My wish is go get something like:
build
├── en
│ └── index.html
├── fr
│ └── index.html
└── index.html
But instead I get something like:
build
└── templates
└── pages
├── en
│ └── index.html
├── fr
│ └── index.html
└── index.html
I did try a few (a lot actually) of combinations (with the flatten
and expand
as well as the cwd
options) but I am stuck.
Using flatten
has for consequence to make the index.html
files to overwrite each others.
So I actually do the rendering into a .tmp directory and then move the files to the build directory.
I do not like that solution because then, the page.assets
is still broken (its value would be ../../..
, for the root index.html).
files
object or other possible syntax. – Lenssen