awoo-pug

1.0.0 • Public • Published

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 under data
  • Any front-matter generated by awoo-matter can be accessed under metadata

Just like other plugins in awoojs/core, a custom filter method can be given under options.filter.

Readme

Keywords

Package Sidebar

Install

npm i awoo-pug

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

4.46 kB

Total Files

9

Last publish

Collaborators

  • luxizzle