Closed iamdriz closed 8 years ago
You add partials to your config object then reference them like you normally would.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
compile-handlebars: {
files: [{
src: 'src/index.handlebars',
dest: 'dist/index.html'
}],
partials: ['partials/_*.handlebars']
}
});
{{> _header}}
CONTENT!
{{> _footer}}
How do I use includes (partials) with this module?
So basically I want to export a file called
index.html
fromindex.handlebars
which will have a header and footer that are stored in_header.handlebars
and_footer.handlebars
.I have this in my
Gruntfile.js
What should be inside the
index.handlebars
to include them? As usually you have to use the Handlebars compile function to create partials... does this support something like what you can do in Jade and just do aninclude(_header)
?