jade-flatiron

0.0.2 • Public • Published

Jade FlatIron Plugin

Description

A flatiron plugin for Jade Templating Language.

Install

npm install jade-flatiron

Usage

var jade = require('jade-flatiron');

app.use(jade({path: __dirname + '/views'}));

app.router.get('/', function() {
  app.render('index', { title: 'App' }, function(err, html) {
    this.res.writeHead(200, { 'Content-Type': 'text/'html' });
    this.res.end(html);
  });
});

app.start(3000);
jade = require 'jade-flatiron'

app.use jade(path: [__dirname, 'views'].join('/'))

app.router.get '/', ->
  app.render 'index', title: 'App', (err, html) ->
    @res.writeHead 200, 'Content-Type': 'text/html'
    @res.end html


app.start 3000

API

On the Attach method, or when the plugin is being called by the app use method. You need to pass in the template path, otherwise the plugin will default to the views directory.

this.render method

The render method uses the default template path and then takes the first parameter which is the filename and attempts to locate the template file. The second parameter is for optional data that can be passed as a Javascript Object.

Readme

Keywords

none

Package Sidebar

Install

npm i jade-flatiron

Weekly Downloads

2

Version

0.0.2

License

none

Last publish

Collaborators

  • beautifulnode