Giter Site home page Giter Site logo

gulp-ssi's Introduction

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

gulp-ssi's People

Contributors

dependabot[bot] avatar etylsarin avatar grabus avatar rmoskal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gulp-ssi's Issues

gulp-util is deprecated

gulp-util has been deprecated recently. Continuing to use this dependency may prevent the use of your library with the latest release of Gulp 4 so it is important to replace gulp-util.

The README.md lists alternatives for all the components so a simple replacement should be enough.

Your package is popular but still relying on gulp-util, it would be good to publish a fixed version to npm as soon as possible.

See:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.