1.0.0 • Published 7 years ago
awoo-pug v1.0.0
awoo-pug
A pug parsing plugin for awoo!
Installation
npm install --save awoo-pug
Usage
const awoo = require('awoo')
const pug = require('awoo-pug')
// start a awoo site
awoo(async site => {
// register the pug plugin
site.use(pug)
return site
})
Locals
When using pug you can add locals that can be accessed in your pug file.
Just like any other plugin you can add options to the plugin
...
site.use(pug, {
locals: {
title: 'My awesome awoo site powered by pug!' // This can be accessed in your pug file!
}
})
...
head
title= title
body
p Hello world!
- A pug vfile's
.data
can be accessed underdata
- Any front-matter generated by
awoo-matter
can be accessed undermetadata
Just like other plugins in awoojs/core, a custom filter method can be given under options.filter
.
1.0.0
7 years ago