Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
gulp-html-ssi2
Advanced tools
gulp-html-ssi plugin for gulp
gulp-html-ssi allows you to compile your html files with includes.
gulp-html-ssi looks through your files for special html comments that it will use to parse them and do the include correctly.
npm install --save-dev gulp-html-ssi
gulpfile.js
Then, add it to your gulpfile.js
:
var gulp = require('gulp'),
includer = require('gulp-html-ssi');
gulp.task('htmlSSI', function() {
gulp.src('./source/**/*.html')
.pipe(includer())
.pipe(gulp.dest('./build/'));
});
gulp.task('default', ['htmlSSI']);
gulp.task('watch', function() {
gulp.watch(['./source/**/*.html'], function(event) {
gulp.start('default');
});
});
gulp-html-ssi requires files follow a particular naming convention.
Files that you want to include in other files begin with _
.
Files that you want to use to build the resulting static pages can be named however you want, as long as they don't begin with _
.
This is the simplest use case. Simply put the following html comment
<!--#include file="_filename" -->
or
<!--#include virtual="_filename" -->
file1.html
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<!--#include file="__file2.html" -->
</body>
</html>
__file2.html
hello world
Results
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
hello world
</body>
</html>
FAQs
基于gulp-html-ssi修改匹配规则,适应nginx服务器的ssi路径规则
The npm package gulp-html-ssi2 receives a total of 0 weekly downloads. As such, gulp-html-ssi2 popularity was classified as not popular.
We found that gulp-html-ssi2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.