0.0.1 • Published 13 years ago
templar-hogan v0.0.1
Templar-hogan 
Hogan.js support for templar and routil
Example
// with templar
var hoganize = require("templar-hogan"),
    Templar = require("templar"),
    path = require("path"),
    templarOptions = hoganize(templar, path.join(__dirname, "..", "template"))
http.createServer(function (req, res) {
    res.template = Templar(req, res, templarOptions)
    // .. later, after figuring out which template to use ..
    res.template('foo.mustache', { 
        some: 'data', 
        for: [ 'the', 'template'] 
    })
}).listen(PORT)
// with routil
var routil = require("routil"),
    hoganize = require("templar-hogan").routil,
    path = require("path")
hoganize(routil, path.join(__dirname, "..", "templates")
http.createServer(function (req, res) {
    // .. later, after figuring out which template to use ..
    routil.template(req, res, 'foo.mustache', { 
        some: 'data', 
        for: [ 'the', 'template'] 
    })
}).listen(PORT)Installation
npm install templar-hogan
Tests
make test
Contributors
- Raynos
MIT Licenced
0.0.1
13 years ago