0.3.0 • Published 8 years ago

overland-nunjucks v0.3.0

Weekly downloads
26
License
MIT
Repository
github
Last release
8 years ago

Overland Nunjucks

Nunjucks view engine for Overland.

import { App } from 'overland/core';
import nunjucks from 'overland-nunjucks';

export default class MyApp extends App {
  public static engine = nunjucks;
}

Then in a controller...

class MyCtrl extends Controller {
  async show(ctx) {
    // Rendered template defaults to 'myCtrl/show.html'
    ctx.body = await ctx.render({ foo: 'bar' });
  }
  async index(ctx) {
    // Specify template as optional first argument
    ctx.body = await ctx.render('template.html', { foo: 'bar' });
  }
}
0.3.0

8 years ago

0.2.0

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago