0.0.2 • Published 13 years ago
docpad-plugin-client-jade v0.0.2
Jade Plugin for DocPad for writing client-side templates
Adds support for Jade as a client-side template language to DocPad.
Convention: .js.cjade
Install
npm install --save docpad-plugin-client-jadeUse
- add https://raw.github.com/visionmedia/jade/master/runtime.min.js to your pages before any client Jade templates
add your templates to the pages as scripts, i.e. having the
documents/templates/something.js.cjade, add it like<script src="/templates/something.js"></script>use it from you script:
var html = JST['something']({contextvar: 'someval'});The 'something' key is obtained from the path file by stripping the
.cjadeextension, then.jsextension (see below how to configure), and then removing some common directory from the beginning of the path (see below how to configure).
Configure
Read on Configuration file here: https://github.com/bevry/docpad/wiki/Configuration
Currently the plugin supports the following options:
namespace– string, the namespace functions are attached to, defaults toJSTprettify– bool, if the output should be prettified, defaults totruein development andfalsein productionbaseDir— string, the base directory (relative to thedocumentsroot) to be stripped from the path when the key is generated, defaults totemplatesstripJsExt– bool, whether to strip.jsextension when the key is generated
License
Licensed under MIT License Copyright © 2012 Eugene Mirotin