Skip to content

Instantly share code, notes, and snippets.

@slavafomin
Last active November 18, 2017 12:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slavafomin/eee7293a9c71d3d654ff11f6d9926c5f to your computer and use it in GitHub Desktop.
Save slavafomin/eee7293a9c71d3d654ff11f6d9926c5f to your computer and use it in GitHub Desktop.
Nunjucks integration with Metalsmith
const Metalsmith = require('metalsmith');
const inPlace = require('metalsmith-in-place');
Metalsmith(__dirname)
.source('./src')
.destination('./build')
.use(inPlace({
pattern: '**/*.njk',
engineOptions: {
path: __dirname + '/src'
}
}))
.build(function (error) {
if (error) {
throw error;
}
})
;
@slavafomin
Copy link
Author

This is an example for my article: Making Metalsmith to work with Nunjucks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment