I am new to Assemble.io and I am using a generator to quickly set up for Foundation 5. However, I am having an issue getting it using alternative templates.
I am able to get the page to generate all pages with the same template but would prefer to obviously have different templates for sections of the site.
Current Gruntfile.js
assemble : {
options : {
layoutdir : '<%= paths.templates %>/layouts',
layout : 'site.hbs',
partials : '<%= paths.templates %>/partials/*.hbs',
assets : '<%= paths.assets %>',
data : '<%= paths.data %>/*.{json,yml}',
helpers : [ '<%= paths.templates %>/helpers/*.js' ],
marked : {gfm : true},
plugins : [ 'assemble-middleware-sitemap','assemble-contrib-permalinks' ],
sitemap : {dest : '<%= paths.dist %>/'},
permalinks : {preset : 'pretty'},
},
about: {
// override task-level layout
options: {
layoutdir : '<%= paths.templates %>/layouts',
layout: 'banded.hbs',
partials : '<%= paths.templates %>/partials/*.hbs',
assets : '<%= paths.assets %>',
data : '<%= paths.data %>/*.{json,yml}',
helpers : [ '<%= paths.templates %>/helpers/*.js' ],
marked : {gfm : true},
plugins : [ 'assemble-middleware-sitemap','assemble-contrib-permalinks' ],
sitemap : {dest : '<%= paths.dist %>/'},
permalinks : {preset : 'pretty'}
},
// files: {'docs/': ['src/content/about/*.hbs' ]},
files : [ {
expand : true,
cwd : '<%= paths.content %>/about',
src : '<%= paths.content %>/about/*.{md,hbs}',
dest : '<%= paths.dist %>/'
} ]
},
// Default
dist : {
files : [ {
expand : true,
cwd : '<%= paths.content %>/',
src : '**/*.{md,hbs}',
dest : '<%= paths.dist %>/'
} ]
}
},
As I am very new to this I have tried several things and looked at the documentation on the Assemble.io site but it does not seem to help here.
Example from Assemble.io site.
assemble: {
options: {
layout: 'default.hbs',
layoutdir: 'layouts'
},
docs: {
// override task-level layout
options: {layout: 'docs-layout.hbs' },
files: {'docs/': ['src/docs/*.hbs' ]},
},
site: {
// override task-level layout
options: {layout: 'site-layout.hbs' },
files: {'site/': ['src/site/*.hbs' ]},
}
// ... other targets
}
So as I mentioned prior the core Foundation site was being generated by Yoeman and I am using generator-sassy-roboyeti so I did not want to stray to far from what it is setting up by default.
Any ideas would be greatly appreciated.
This is not exactly the answer but I did find an alternative method.
Instead of telling each section to use layouts I am just adding which layout the file should use for each single HTML file. I think this is far easier.
Updated Gruntfile.js
Now in my /about/index.hbs
title: About description: This is my about page.
layout: banded.hbs
Hi, this is the about page.