在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):FrankFang/gulp-html-extend开源软件地址(OpenSource Url):https://github.com/FrankFang/gulp-html-extend开源编程语言(OpenSource Language):JavaScript 82.8%开源软件介绍(OpenSource Introduction):gulp-html-extendMake it easy to extend, include and replace your html filesmaster.html <body>
<!-- @@placeholder= content -->
<!-- @@placeholder =footer -->
</body> content.html <!-- @@master = master.html-->
<!-- @@block = content-->
<main>
my content
</main>
<!-- @@close-->
<!-- @@block = footer-->
<footer>
my footer
</footer>
<!-- @@close--> output <body>
<!-- start content -->
<main>
my content
</main>
<!-- end content -->
<!-- start footer -->
<footer>
my footer
</footer>
<!-- end footer -->
</body> Features
Install$ npm install --save-dev gulp-html-extend SyntaxP.S. [=] means the @@master [=] path [jsonString] e.g. @@placeholder [=] blockName e.g. @@include [=] path [jsonString] e.g. @@var [=] variableName e.g. @@block [=] blockName e.g. @@close You must add Usagevar gulp = require('gulp')
var extender = require('gulp-html-extend')
gulp.task('extend', function () {
gulp.src('./*.html')
.pipe(extender({annotations:true,verbose:false})) // default options
.pipe(gulp.dest('./output'))
})
gulp.task('watch', function () {
gulp.watch(['./*.html'], ['extend'])
})
... Optionsannotations [bool] Make it verbose [bool] Show extra info in the console. root [string (dir path)] Enable absolute paths which start with Changelog
LicenseMIT © Frank Fang |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论