gulp-pug

Gulp plugin for compiling Pug templates

Github stars Tracking Chart

gulp-pug Build Status Dependencies Downloads

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:

var pug = require('gulp-pug');

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 to pug's own options.
  • opts.locals (Object): Locals to compile the Pug with. You can also provide locals through the data field of the file object, e.g. with gulp-data. They will be merged with opts.locals.
  • opts.data (Object): Same as opts.locals.
  • opts.client (Boolean): Compile Pug to JavaScript code.
  • opts.pug: A custom instance of Pug for gulp-pug to 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

Thanks

LICENSE

MIT © Jamen Marzonie

Main metrics

Overview
Name With Ownergulp-community/gulp-pug
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 1)
Platform
License:MIT License
所有者活动
Created At2013-07-06 00:38:04
Pushed At2023-06-12 13:05:11
Last Commit At2021-06-08 21:25:08
Release Count27
Last Release Namev5.0.0 (Posted on )
First Release Namev0.2.0 (Posted on 2013-12-12 16:58:40)
用户参与
Stargazers Count520
Watchers Count12
Fork Count79
Commits Count139
Has Issues Enabled
Issues Count140
Issue Open Count2
Pull Requests Count50
Pull Requests Open Count2
Pull Requests Close Count35
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private