Skip to content

Lynncubus/awoo-pug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A pug parsing plugin for awoo

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published