sourcejs-swig
v1.0.0
Published
Swig support for SourceJS
Readme
Swig support for SourceJS
SourceJS middleware to support Swig template language (*.swig or *.swig.html) instead of native *.src.
Install
To install, run npm in sourcejs/user folder:
npm install sourcejs-swig --saveIn sourcejs/user/options.js you need to add index.swig or index.swig.html to rendering.specFiles:
module.exports = {
rendering: {
specFiles: [
'index.swig',
'index.swig.html',
'index.src',
//...
]
}
//...
};Then restart your SourceJS application, middleware will be loaded automatically.
Usage
After installing middleware, instead of index.src pages, you can index.swig.html files with Swig markup.
index.swig
{#
This is a comment.
It will be fully stripped and ignored during parsing.
#}
<h1>{{ specData.info.title|title }}</h1>