在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):fchasen/gulp-liquify开源软件地址(OpenSource Url):https://github.com/fchasen/gulp-liquify开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):Gulp LiquifyA Liquid template render using TinyLiquid Installation$ npm install gulp-liquify Usagevar liquify = require('gulp-liquify');
gulp.task("liquify", function() {
var locals = {
name: "Fred"
};
gulp.src('*.liquid')
.pipe(liquify(locals))
.pipe(gulp.dest('./dist/'))
}); You can pass a base for other templates to be included in a template. It defaults to the file base. gulp.src('*.liquid')
.pipe(liquify(locals, { base: "../templates/" }))
}); You can pass file specific locals by attaching it to the vinyl file object in a previous task. var liquify = require('gulp-liquify');
var through = require('through2');
gulp.task("liquify", function() {
var locals = {
name: "Fred"
};
gulp.src('*.liquid')
.pipe(through.obj(function(file, enc, cb) {
file.locals = {
number: Math.random(),
path: file.path
};
cb(null, file);
}))
.pipe(liquify(locals))
.pipe(gulp.dest('./dist/'))
}); tinyliquidLiquid support fromTinyLiquid does not support the locals variables like this:
Only support to use |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论