overland-nunjucks
v0.3.0
Published
Nunjucks view engine for Overland.
Downloads
2
Readme
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' });
}
}