Skip to content

pkyeck/connect-nunjucks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

connect-nunjucks

this middleware is based on the browser-sync-nunjucks package.

nunjucks works with expressjs out of the box, but we wanted to use the module as a middleware for browser-sync - so here you go.

Example use

var nunjucksMiddleware = require('connect-nunjucks');

express.use(
  nunjucksMiddleware({
    baseDir: 'src',
    // default extension if non is supplied
    ext: '.html',
    // possible debug values: true, false, 'browser', 'console'
    debug: true,
    // custom nunjuck filters
    filters: require('./custom-filters'),
    context: {
      dataInTemplates: {
        value1: 'whatever'
      }
    }
  })
);

About

Nunjucks middleware for connect / express

Resources

Stars

Watchers

Forks

Packages

No packages published