gs

gulp-ssi

Server Side Includes parser plugin for gulp

Showing:

Popularity

Downloads/wk

44

GitHub Stars

5

Maintenance

Last Commit

1yr ago

Contributors

4

Package

Dependencies

3

Size (min+gzip)

14.4KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

gulp-ssi

NPM version Build Status

Server Side Includes parser plugin for gulp

Works with both include types

<!--#include file="includes/navigation.html" -->
<!--#include virtual="../templates/navigation.html" -->

And now also correctly interprets directives from the root of a site

<!--#include file="/includes/navigation.html" -->

Usage

First, install gulp-ssi as a development dependency:

npm install --save-dev gulp-ssi

Then, add it to your gulpfile.js:

var ssi = require("gulp-ssi");

gulp.src("./src/*.ext")
    .pipe(ssi())
    .pipe(gulp.dest("./dist"));

Options

var ssi = require("gulp-ssi");

gulp.src("./src/*.ext")
    .pipe(ssi({root:'/some/path'}))
    .pipe(gulp.dest("./dist"));

root (optional)

Type: String
Default: File directory

Set the location where the linked files are hosted. I've preserved this feature to prevent breaking existing clients. It works fine, but it makes assumptions that all relative links eventually resolve to the root of the root directory. So...

With a root of /myroot and an include that looks like <!--#include file="../../deeper/one.inc" --> ssi will look for a file at this path:
/myroot/deeper/one.inc. See the tests for more information. I look forward to better ideas about this.

License

MIT License

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100