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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?