static-jade
v1.0.1
Published
Serve static Jade files from an Connect(Express) server.
Downloads
4
Readme
static-jade
Serve static Jade files from an Connect(Express) server.
Installing
It's an NPM package. You can just do the following.
npm install static-jade
Usage
Simple
var server = require("connect")();// require("app")() .
server.use(require('static-jade')(path.join(__dirname,"views")));
Default Options
var server = require("connect")();// require("app")() .
server.use(require('static-jade')({
src:path.join(__dirname,"views")
extname: "", // if you want to use it,I advise you use words like ".html","_html" or "._". !!!don't use "/"!
next2data:false, // if true ,you can get jade'option from before route
defaults:{}, // jade default option
routes:{"/":"/index"} // "*/" will not go to "*/index.jade",will clear the last "/";
}));
next2data
var server = require("connect")();// require("app")() .
server.use("/",function(req,res,next){
next({
message:"love"
type:"jade"
})
});
server.use(
require('static-jade')({
src:path.join(__dirname,"views")
next2data: true
})
);