- a shell script that I use to maintain a static blog
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

A bash blog engine

v 0.1.0

I wrote this to learn bash. It's a very simple program -- all it does update files. It's pretty fragile and will probably break if:

  • The folder hierarchy is missing essential folders
  • A template file is missing
  • And many more!

Additionally, there is no real RSS or Javascript support, and no comments.

It definitely works for my purposes and perhaps you will get something out of it too.

Usage requires rsync and markdown.

Run ./ -i to create the proper folder hierarchy. Or, you can clone this project and start editing.

The folder hierarchy is as follows:

  • draft - this is where you put files you'd like to include on your blog.
  • draft/images - place images here. Currently only 'supporting' png due to an idiosyncracity of my blog engine + rsync that I haven't figured out.
  • draft/css - place css here.
  • draft/blog - contains blog posts, in markdown format.
  • draft/index - contains static pages, in markdown format.
  • draft/templates - templates go here. These are used in conjunction with the blog posts and static pages to create html files.
  • live - this is the constructed website. It contains html generated from draft/index, and css files.
  • live/images - all images reside here.
  • live/blog - all blog posts reside here.

Run ./ -u to update the contents of live with the contents of draft.

Run ./ -h to see the other commands blosh accepts. (There's not many.)

Warning: New pages and page/image/css updates are handled by the script, but page/image/css deletion needs to be done by hand.


  1. Prepare a folder on your computer named "my-blog" and make it your current working directory.

  2. git clone this repository.

  3. You should now see a file and two directories, draft and live. Fire up your favorite editor and type whatever's on your mind. Use markdown format if you feel like it. Save the results to draft/blog/

  4. Run ./ -uv.

  5. Run a small http server (such as SimpleHTTPServer) from live. Navigate to its root in your web browser. You should see something like the below:

Screenshot of tutorial webpage

  1. Create more posts and save them to draft/blog/. You should give them small names like or, and don't use spaces or underscores in the name, just hyphens.

  2. Run ./ -uv again.

  3. Reload the page in your web browser. You should see the last post you made as your site's index.

  4. Click the "history" link. You should see a list in reverse chronological order of all the blog posts you made!


Copyright (c) 2014 P Smith

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see