An extremely lightweight blogging backend for node.
A dead simple blogging backend that lets you drop in a Markdown formatted blog to any existing Node.js site. It handles parsing and processing posts, but makes you set up your own site (routes and templates).
There are tons of sweet static content generators out there that are perfect for many sites built from the ground up as blogs, but they do so much for you that it's more difficult to integrate them with existing sites.
Posts are stored in a single folder, with the name format
The title in the file name is the one you'd use in a URL, and should be free of
Metadata is stored at the beginning of post files in YAML, delimited by
The remainder of the post is standard Markdown.
npm install blog-base
Next, create a
Blog and point it to your post folder:
var Blog = require'blog-base'var blog = __dirname + '/blog-posts'
Then, define some routes for your blog, however you like.
Blog provides these
count posts starting at
offset in reverse chronological order. If
count are not specified, returns all posts in reverse chronological order.
blog.posts, but returns posts that include the tag
Returns the post published on
day having name
Returns the total number of posts.
Returns the total number of posts that include the tag
Rebuild the cache of posts from the filesystem. Done automatically on file modification if inotify is installed.