Laravel Mix extension to compile Nunjucks templates with markdown and front-matter support
npm install laravel-mix-nunjucks --save-dev
This extension performs following tasks
_
or under _*
directorypage
variableconst mix = require('laravel-mix')
require('laravel-mix-nunjucks')
mix.njk('resources/views/', 'public/', {
// ext: '.html',
// data: {},
// marked: null,
// envOptions: null,
// manageEnv: (nunjucks) => {},
})
ext
- Extension for compiled templates, pass null or empty string if yo don't want any extensiondata
- Data passed to templateblock
- Name of content block in your parent templatemarked
- Custom options for markedenvOptions
- These are options provided for nunjucks Environment. More info here.manageEnv
- Hook for managing environment before compilation. Useful for adding custom filters, globals, etcFor more info about nunjucks, check https://mozilla.github.io/nunjucks/api.html