grunt-bildung
v0.0.11
Published
A static website generator to use with Grunt
Downloads
1
Readme
bildung
bildung
is a Grunt plugin for generating static websites. Inspiration from Jekyll and similar tools. Prior art: grunt-pages
by @crhisawren et al.
Note: This project is still in its early stages, so the API is subject to changes.
Usage
See Gruntfile.js
for an example usage.
Options
destination
Type: String
Default: dist
The destination folder for the generated website.
content
Type: String
Default: content
The path to the articles.
assets
Type: String
Default: assets
The path to the assets folder, the contents of which will be copied as is to the destination folder. Put your CSS, JS, images and what-not here.
templates
Type: String
Default: templates
The path to the templates folder, which are used to render the articles.
index_template
Type: String
Default: list
The name of the template to use for the index page (which contains the list of all articles).
permalink
Type: String
Default: :year/:month/:day/:slug
The permalink to each individual post. You can use any property from the Article
class (described below).
sort
Type: Function
Default: Sort by date (recent first)
The sort function to use when generating the list of articles for the index page.
filter
Type: Function
Default: Exclude filenames starting with _
(we consider those are drafts)
The filter function can be used to exclude some articles from the generation process.
marked
Type: Object
Send options directly to the marked
plugin. See its documentation for available options.
moment
Type: String
Default: MMM D, YYYY
The format to use with moment.js
for generating the human-readable date for the article.
datetime
Type: String
Default: YYYY-MM-DD
The format to use with moment.js
for generating the machine-readable date for the article.
rss
Type: Object
/Boolean
Set rss: false
to skip RSS generation. The various options if you do want to create a RSS feed:
title
String
Title of the feed; if missing, falls back to thetitle
option on the global config object.description
String
Description of the feed; if missing, falls back to thedescription
option on the global config object.posts
Number
(default:20
) The number of posts to include in the RSS feed.author
String
The author of the feed; if missing, falls back to theauthor
option on the global config object. Other RSS options you can specify:managingEditor
,webMaster
(they fall back toauthor
).
The Article
class
metadata
title
title of the articledate
rawDate
for the articleyear
year of the article (4-digit number)month
month of the article (1 to 12)day
day of the article (1 to 31)moment
human-readable article date with the format controlled by themoment
optiondatetime
machine-readable article date with the format controlled by thedatetime
optionslug
article slugpermalink
permalink to the articlebasepath
path to the root of the site (taking into account the permalink pattern)template
the name of the template to use for rendering the article (default isarticle
)
filename
file name of the source file, useful for filtering out drafts (seefilter
option)content
HTML content of the article passed throughmarked
(seemarked
option for parser configuration)
Note: The metadata
object for each article will reflect all the properties from the article's front matter. Careful with the name collisions though, there's no check -- if you use any of the properties outlined under metadata
above, they most certainly will be overwritten (YOLO).