bumble
v3.0.1
Published
A very simple blog
Downloads
2,052
Readme
bumble
A very simple markdown blog module
- Serve markdown + yaml text files from configurable directory
- Provide date-based archives
- Adds Gravatar based on Author email
- Read Tumblr URLs and
301 Redirect
- Comes with simple, default templates and styles (in the
example
folder). - Uses hapi
Add the module to your app
npm install bumble
var Hapi = require('hapi');
var config = require('./bumbleConfig.json');
var server = new Hapi.Server('0.0.0.0', 3000 || process.env.PORT);
server.views({
engines: { jade: 'jade' },
path: 'views',
});
server.route({
method: 'get',
path: '/css/{path*}',
handler: { directory: { path: 'public/css' } }
});
server.route({
method: 'get',
path: '/js/{path*}',
handler: { directory: { path: 'public/js' } }
});
server.pack.require({ 'bumble': config }, function (err) {
if (err) throw err;
server.start(function () {
console.log('bumble running on the port ' + server.info.port);
});
});
The above should enable you to quickly run bumble from a docker instance.
Check out the full example for some simple default templates and styles.
Set your defaults in bumbleConfig.json
{
"blogTitle": "Name of blog",
"blogSubtitle": "Here's a tag line",
"blogAuthor": "Blog Author",
"blogAuthorEmail": "[email protected]",
"blogBio": "One day, I decided to write a blog. This is the story of that blog.",
"siteUrl": "http://example.com",
"rssUrl": "http://example.com/feed/rss",
"postDir": "posts",
"blogHome": "/",
"maxPosts": 10,
"introPostWords": 100,
"maxRelated": 5,
"randomRelated": true,
"browserCache": 3600000,
"labels": ["blog", "http"]
}
maxPosts
will set the maximum number of posts available on the main page and RSS feed.
introPostWords
will truncate the opening paragraphs at 100 words, including at least the opening paragraph, and never cutting off a line mid-sentence.
maxRelated
limits the number of related posts shown in a single post view.
randomRelated
determines whether related posts should be shuffled or not. (If false, this will instead list your maximum of related posts in order of recency.)
blogHome
will accept routes like /
or /blog
or /somethingelse
.
labels
can be a string or an array, or not provided at all. Please see Hapi API docs for more info on labels
Put markdown files in the blog
directory (or whichever you've chosen in postDir
)
If you add to the metadata (1) a proper timestamp to the date
field in metadata, and/or (2) a hyphenated version of the url name to the slug
field, then (respectively of which you add) it doesn't matter what you name the markdown files.
Alternatively, to automatically date and slugify your urls, name your files in this format:
YYYY-MM-DD-this-is-the-name-of-the-post.md
Adding metadata:
Just include a simple section of YAML at the header of each post, fenced in with three dashes and using these keys:
---
date: 2013-06-02 22:04:39 GMT
slug: well-yep-another-post
tags: sample, example
title: Well, yep, another post!
---
Who uses bumble?
If you're using bumble, submit a pull request and add yourself to this list. :)