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.
markdown => static HTML under
tags => static HTML under
Disqus => simply add your Disqus shortname to
Twitter => add your username to
RSS => generates an RSS feed at
metadata => Posts can be written with metadata that you can integrate with your own custom templates
drafts => drafts work by adding
draft: trueto a post's metadata header
syntax highlighting => done at compile time with the awesome
moment.js helper => moment.js helpers are included in the template layer, so you can easily work with dates
pagination => WIP
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
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 postdraft: truepublishDate: 2016-07-15tags: 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.
Since brunch uses a
brunch-config.js file, you can add helpers by simply requiring them and adding them to the
Brunch_Blogdefaults =// input folder where your Markdown files live.inDir : "blog"// the public folder where the blog lives atoutDir : "blog"// the folder in the app root where templates livetemplatesDir : "templates"// things you want to configure for compile timesite :title : "Blog'o'Brunch"// used for permalink generationurl : ""disqus : nulltwitter : nullgithub : null// RSS options from the `rss` modulerss :generator : "Brunch"length : 20