If you don't see the right helper, you can write your own. Add a javascript file to 'src/helpers'
, add helpers: 'src/helpers'
to the Panini process in your gulpfile.babel.js
, restart npm, then call it in your templates.
// Example file src/helpers/bold.js
module.exports = function(options) {
// options.fn(this) = Handelbars content between
var bolder = '<strong>' + options.fn(this) + '</strong>';
return bolder;
}
// Example gulpfile.babel.js
function pages() {
return gulp.src('src/pages/**/*.html')
.pipe(panini({
root: 'src/pages',
layouts: 'src/layouts',
partials: 'src/partials',
helpers: 'src/helpers'
}))
.pipe(inky())
.pipe(gulp.dest('dist'));
}
Then in your projects call your custom {{#bold}} helper
{{#bold}}ideas{{/bold}}