Get assemble partial files
$ npm i --save get-assemble-partials
In assemble plugin:
var getPartials = require('get-assemble-partials');
module.exports = function (params, cb) {
getPartials(params, function (err, data) {
console.log(data);
// => [ 'src/partials/footer.hbs',
'src/partials/header.hbs',
'src/partials/nav.hbs',
... ]
cb();
});
};
module.exports.options = {
stage: 'render:post:pages'
};
A list of glob pattern that you want to exclude.
type: array
var getPartials = require('get-assemble-partials');
module.exports = function (params, cb) {
var excludes = ['./src/partials/excludes/*.hbs'];
getPartials(params, excludes, function (err, data) {
console.log(data);
// => [ 'src/partials/footer.hbs',
'src/partials/header.hbs',
'src/partials/nav.hbs',
... ]
cb();
});
};
module.exports.options = {
stage: 'render:post:pages'
};
MIT