bumbler
v0.6.1
Published
A DIY, filesystem-based CMS for photos, music, microblogging, blogs, or whatever
Downloads
8
Readme
Bumbler
A straightforward, file-based CMS and build system for photos, art, statuses, audio, blog posts or whatever. It's optimized for microblogging, but can be used for regular blogging too.
Look at the example deployment here, and check out some example themes here.
Screenshots
Features
- Static files for MAXSPEED, easy migration, and easy administration
- Built-in support for
- tags
- custom pages
- static file linking
- zero configuration Atom feed
- Awesome, easy theming
- favicon generation
- more to come
- Plugin system in development
- Two ways to publish:
- Self-host and instantly publish from anywhere, anytime
- Write locally and push to github-pages, Neocities, or any other system
User guide
Installation
step 0: install Node.js v7+ and NPM, and open a terminal.
npm install -g bumbler
- Create a new folder for your site
- Go into your new site folder with
cd
- Run
bumbler init
and follow the directions- On Windows, you need admin access to create symbolic links, which Bumbler will do. Sorry :(
- Run
bumbler
to start up your site - Navigate to
localhost:3000
in a web browser to see it, and go tolocalhost:3000/admin
to start making posts and customizing your site. The UI should explain itself.
Directories
Bumbler creates a subfolder called _bumblersrc
, which is where all of your site data is stored for building your site. Here's its directory structure:
_bumblersrc/
║
║ # Things you should modify manually:
║ #┌────────────────────┴────────────────────────┐
╠═static/ # Put static files here │
╠═favicon.png # Put an icon for your site here │
╠═plugins/ # plugins go in here |
╠═scripts/ # scripts go in here |
║ #└─────────────────────────────────────────────┘
║
║ # Things you should just use the UI for:
║ # ┌───────────────────┴────────────────────────┐
╠═bumbler.json # site settings │
╠═posts/ # Your post data lives here │
╠═pages/ # custom pages │
╚═assets/ # file uploads go here │
# └────────────────────────────────────────────┘
Publishing Guide
Self-Hosting
If you have an extra $7/month, you can host it on DigitalOcean ($5), with backups ($1), and get a domain ($1). Here are some tips:
- Bumbler will not work on Heroku or other SAAS platforms with an ephemeral filesystem, because of Bumbler's filesystem-based nature. All of your files and settings will get blown away every 24 hours or so.
- Install nodejs v7 using the instructions here: https://github.com/nodesource/distributions#deb
- Use HTTPS
- Set up backups in case your site explodes, or hackers get in and ruin everything.
Static Hosting
Bumblr builds a static site, which means unlike a conventional CMS, the final site is just a bunch of files. You can simply move your files over to a HTTP server and everything will just work.
One easy way to make this work is to drop a shell script in _bumblersrsc/scripts
that pushes your site data out. Then you can simply run it from the admin interface later.
Developer Guide
Developing Plugins
Bumbler has a plugin system!
Your plugin gets passed two parameters: the plugin library and a ready callback.
You must call the ready callback with any errors and any hooks you want to handle.
Here's a simple example with hooks:
// _bumblersrc/plugins/last-updated.js
// Put a generationDate value on every page when the site builds
module.exports = function(pluginLib,pluginReady){
var hooks = {
beforePageRender:function(oldPage,done){
var page = JSON.parse(JSON.stringify(oldPage));
page.generationDate = new Date().toISOString();
done(null,page);
}
};
// we're ready right away
pluginReady(null,{hooks});
}
Here's a more complex example of how you could use Bumbler to publish some other feed's data:
// _bumblersrc/plugins/feed-subscriber/index.js
const subscribe = require('theoretical-atom-subscription-library');
module.exports = function(pluginLib,pluginReady){
subscribe('www.myotherwebsite.com/atomfeed.xml').on('new-post',item=>{
var postData = {title:item.title,caption:item.caption};
pluginLib.putPost(postData,(er)=>{
pluginLib.buildPages();
});
});
// this plugin uses no hooks
var hooks = {};
// we're ready right away
pluginReady(null,{hooks});
}
Available hooks
beforePageRender: function(existingPageData,done)
=> you must call done(error,modifiedData)
pluginLib
methods
pluginLib.putPost(postObject,done)
=> add a post, or modify it by its ID. Use this to create new posts from another source.
pluginLib.buildPages(done)
=> rebuild the site pages if you add a new post, or any other reason.
Developing Bumbler itself
The easiest way to develop is in one terminal run gulp watch
and in another terminal run cli.js --dir test/kitties
.
Building is handled by Gulp. There are a few commands you can run:
gulp
builds bumbler for developmentgulp dist
builds bumbler for distribution / productiongulp watch
builds bumbler for development and will build it again whenever files change
This project compiles pug to html, scss to css, and js to js via browserify + babel. All built source files are located in dev-src/