Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

brunch-blog

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

brunch-blog

A static blog compiler for brunch

  • 3.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

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

  • markdown => static HTML under ./public/blog

  • tags => static HTML under ./public/tags

  • Disqus => simply add your Disqus shortname to config.plugins.blog.site

  • Twitter => add your username to config.plugins.blog.twitter

  • RSS => generates an RSS feed at ./public/rss.xml

  • metadata => Posts can be written with metadata that you can integrate with your own custom templates

  • drafts => drafts work by adding draft: true to a post's metadata header

  • syntax highlighting => done at compile time with the awesome highlight.js

  • 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 ./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 = {
  // input folder where your Markdown files live.
    inDir         : "blog"
  // the public folder where the blog lives at
  , outDir        : "blog"
  // the folder in the app root where templates live
  , templatesDir  : "templates"
  // things you want to configure for compile time
  , site          : {
      title       : "Blog'o'Brunch"
    // used for permalink generation
    , url         : "https://www.example.com"
    , disqus      : null
    , twitter     : null
    , github      : null
    // RSS options from the `rss` module
    , rss         : {
        generator : "Brunch"
      , length    : 20
    }
  }
}

Keywords

FAQs

Package last updated on 17 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc