Gulp plugin for including HTML files into each other. Made for fun and my personal needs, but I'll appreciate if anyone will use it \( ﾟヮﾟ)/
I know, there are some long-time solutions like gulp-file-include, but I wanted to create something on my own with html-like syntax.
Supports nested partials and passing parameters as attributes.
- gulp (>=3.9.1) (guess it'll work with older versions too)
- Node (>=6.5.0) (not sure 4.x will handle all ES6 stuff)
npm install --save-dev gulp-html-partial
Files are included in
@@titleSome spanSome text
Some text@@param@@dashed-paramSome text
Some titleSome spanSome textSome textNested partialSome-dashed-paramSome text
const gulp = ;const htmlPartial = ;gulp;
const defaults =basePath: ''tagName: 'partial'variablePrefix: '@@'
basePath- base path for your partials, relative to
tagName- name of your partial tag, must have at least
srcattribute with path to partial file
variablePrefix- prefix of variable keys passed as attributes into partials
- missing partials defaults to empty string
- errors fire as logs, not as events, to make sure every, not only the first one, missing partial will be described - but I guess there is a way to make that work with events too