gulp-pug

Gulp plugin for compiling Pug templates

Github星跟踪图

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

主要指标

概览
名称与所有者gulp-community/gulp-pug
主编程语言JavaScript
编程语言JavaScript (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2013-07-06 00:38:04
推送于2023-06-12 13:05:11
最后一次提交2021-06-08 21:25:08
发布数27
最新版本名称v5.0.0 (发布于 )
第一版名称v0.2.0 (发布于 2013-12-12 16:58:40)
用户参与
星数520
关注者数12
派生数79
提交数139
已启用问题?
问题数140
打开的问题数2
拉请求数50
打开的拉请求数2
关闭的拉请求数35
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?