From: Ethan Hackett Date: Mon, 4 Apr 2016 17:41:55 +0000 (-0400) Subject: Update Panini Docs : Custom Helpers X-Git-Tag: v6.2.1~24^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5239ef35fc42a099bd4f0815dd36a4584ea822dc;p=thirdparty%2Ffoundation%2Ffoundation-sites.git Update Panini Docs : Custom Helpers Update Panini docs https://github.com/zurb/foundation-sites/pull/8522 --- diff --git a/docs/pages/panini.md b/docs/pages/panini.md index b343c49bf..3b76e22ff 100644 --- a/docs/pages/panini.md +++ b/docs/pages/panini.md @@ -173,7 +173,7 @@ Lorem ipsum [dolor sit amet](http://html5zombo.com), consectetur adipisicing eli ### Custom Helpers -If you don't see the right helper, you can write your own. Add a javascript file to 'src/helpers', restart npm, then call it in your templates. +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 @@ -183,6 +183,22 @@ module.exports = function(options) { 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 ```