grunt-writing
Generate a simple collection of HTML posts from markdown, and an index of teasers.
Getting Started
This plugin requires Grunt ~0.4.1
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-writing --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt;
The "writing" task
Overview
In your project's Gruntfile, add a section named writing
to the data object passed into grunt.initConfig()
.
grunt;
Example Config
grunt;
Templates
All templates are expected to be written in jade. The templates folder must contain a minimum of 3 files: post.jade
, index.jade
& archive.jade
. You're free to use whatever layouts / mixins you want, but you can't change the names of these files.
The post
object is available to the post.jade
template. The posts
array is available to the index.jade
and archive.jade
templates. The meta
object is available to all 3 templates (as well as your layouts).
RSS Feed
The rssURL
property is added to the meta
object for use in templating.