4.0.6 • Published 7 years ago
gulp-pug-frontmatter-support v4.0.6
DEPRECATED
Use gulp-frontmatter-wrangler instead!
Frontmatter support!
Using this plugin, this Pug code...
---
title: My Site
---
h1 Welcome!...Compiles to this!
---
title: My Site
---
<h1>Welcome!</h1>gulp-pug

Gulp plugin for compiling Pug templates
This Gulp plugin enables you to compile your Pug templates into HTML or JS, with support for template locals, custom Pug filters, AMD wrapping, and others. Here is a simple example using gulp-pug:
Installation: npm install gulp-pug-frontmatter-support -D
var pug = require('gulp-pug-frontmatter-support');
gulp.task('views', function buildHTML() {
return gulp.src('views/*.pug')
.pipe(pug({
// Your options in here.
}))
});API
pug([opts])
opts(Object): Any options from Pug's API in addition topug's own options.opts.locals(Object): Locals to compile the Pug with. You can also provide locals through thedatafield of the file object, e.g. withgulp-data. They will be merged withopts.locals.opts.data(Object): Same asopts.locals.opts.client(Boolean): Compile Pug to JavaScript code.opts.pug: A custom instance of Pug forgulp-pugto use.opts.verbose: display name of file from stream that is being compiled.
To change opts.filename use gulp-rename before gulp-pug.
Returns a stream that compiles Vinyl files as Pug.
Also See
puggulp-pug: The original version of this Gulp plugin. Does not have frontmatter support.gulp-data: Using locals in your Pug templates easier.gulp-rename: Changeopts.filenamepassed into Pug.gulp-wrap-amd: Wrap your Pug in an AMD wrapper.
Thanks
- Many thanks to Blaine Bublitz for the original
gulp-jadeplugin.
LICENSE
MIT © Jamen Marzonie