Brunch Blog Plugin
npm install brunch-blog --save-dev
You may be saying to yourself... OMG, why another static blog utility?
Brunch didn't seem to have one, and I like brunch.
Features
This plugin is for generating a static blog quickly and seamlessly with your regular Brunch workflow.
It comes with a few sensible defaults, and will install the necessary - pug templates to quickly prototype a blog
By default posts live in the ./blog
directory and not ./app/blog
Templates also live in ./templates
and not ./app/templates
because templates in your app directory are assumed to be SPA templates (ala Dust.js or what have ye) and not for static assets.
Writing a blog post
Writing a blog post is generally simple and utilizes an optional YAML metadata header
---
tile: some post
draft: true
publishDate: 2016-07-15
tags: awesomesauce, awesomepossum, epic
---
Some amazingly well written content here!
all key values in the metadata header section are passed into your pug
templates on render and require no special work from you.
Custom helpers
Since brunch uses a brunch-config.js
file, you can add helpers by simply requiring them and adding them to the site
key
Config
Brunch_Blog.defaults = {
inDir : "blog"
, outDir : "blog"
, templatesDir : "templates"
, site : {
title : "Blog'o'Brunch"
, url : "https://www.example.com"
, disqus : null
, twitter : null
, github : null
, rss : {
generator : "Brunch"
, length : 20
}
}
}