gulp-html-ssi
gulp-html-ssi plugin for gulp
Introduction
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.
Usage
Install
npm install --save-dev gulp-html-ssi
gulpfile.js
Sample Then, add it to your gulpfile.js
:
var gulp = includer = ; gulp; gulp; gulp;
API
File naming convention
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 _
.
Include
This is the simplest use case. Simply put the following html comment
<!--#include file="_filename" -->
or
<!--#include virtual="_filename" -->
Example
file1.html
Document<!--#include file="__file2.html" -->
__file2.html
hello world
Results
Document hello world