Adds Jade static pages support to brunch.
This plugin compile Jade templates into their HTML representation and create separate file for each input source file without wrapping it in AMD/CommonJS modules.
Install the plugin via npm with
npm install --save jade-pages-brunch.
Or, do manual install:
package.jsonof your brunch app.
Plugin settings could be defined in the
plugins.jadePages section of the brunch config. Defaults are:
exports.config =...plugins:jadePages::pathreplace /^app[\/\\]\.jade$/"$1.html"jade:doctype: "html"htmlmin: false
You could compile only certian Jade pages by specifying
pattern option. By default all files with
jade extension are compiled.
exports.config =...plugins:jadePages:pattern: /^app\/pages\/.*\.jade$/
You could specify custom place for compiled Jade pages via
destination option. It should be Function which takes path of the source file and return destination file path String (relative to the public path). All intermediate directories in the path are created automatically.
By default all Jade pages in
app/ are compiled to
public/ with the same directory structure and have
You could specify Jade options and template locals in the
jade.locals sections accordingly. Example:
exports.config =...plugins:jadePages:jade:doctype: "xml"pretty: truelocals:varname: "123"
You could specify Jade filters in the
filters section. Example:
exports.config =...plugins:jadePages:filters:: '<?php \n' + text + '\n?>':pathreplace /^app[\/\\]\.jade$/"$1"
:php// ...$answer = 42;// ...doctype htmlhtml(lang="de")bodyp It's <?= $answer ?>!
You could minify compiled templates using html-minifier by passing following values to the
true. Default options are:
removeComments: trueremoveCommentsFromCDATA: trueremoveCDATASectionsFromCDATA: truecollapseBooleanAttributes: trueuseShortDoctype: trueremoveEmptyAttributes: trueremoveScriptTypeAttributes: trueremoveStyleLinkTypeAttributes: true
Note that by default HTML minification is disabled and using minification with agressive options could break things.
exports.config =...plugins:jadePages:htmlmin:removeComments: truecollapseWhitespace: trueremoveEmptyAttributes: true
Because static-jade-brunch and jaded-brunch don't compatible with another plugin which I use, jade-ngtemplates-brunch. They are both using
templates brunch option and enter into a conflict with each other.
And I don't want to implement jade-pages functionality as a part of jade-ngtemplates-brunch (like it was done for example in jade-angularjs-brunch) because it contradicts with plugins modularity spirit.
Unfortunately Brunch doesn't provide a lot of flexibility for plugins. From it's point of view templates are always compiled into single JS file so we need to hack it out and write resulting compiled pages by ourself. Since we did it, another plugin wouldn't make any sense.
In this issue goes discussion about Brunch architecture improvements but no real progress is done for now.
jade-pages-brunch - Adds Jade static pages support to brunch
Written in 2014 by Kagami Hiiragi firstname.lastname@example.org
To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see http://creativecommons.org/publicdomain/zero/1.0/.