public
Description: Static blogging system based on Makefiles and unix filters
Homepage:
Clone URL: git://github.com/sorbits/waterfowl.git
README.mdown

Introduction

This is a blogging system meant to replace my current WordPress install. I haven’t deployed it yet, since things are still missing (see the TODO).

IMPORTANT: This is not prepared for public use yet. It is likely not going to work for you out of the box.

The things I want from this system are:

  1. Plain-text posts (RFC822-style). I occasionally need to make batch edits, so I prefer having actual files instead of posts stored in a database. Also, this allows easy version-control of blog posts and similar.

  2. Static content. Mainly because of the speed/resource gains. While a caching solution could be added on-top of a dynamic system, I feel that this is just making things more complex than they need be.

  3. Easy filter system. I write my posts in Markdown, I want my image tags to contain dimensions, my email addresses to be obfuscated, my code samples to be syntax highlighted, etc. Filtering content should work just like unix pipes, so a filter can be written in an arbitrary language and simply take the content on stdin and outputs the filtered content on stdout.

  4. Comments. Yes, I do want to support comments, there is no ban against CGI, it just only needs to be used where it makes sense.

  5. Make-based. By using (auto-generated) makefiles we both have easy access to a well tested and easy to use dependency tracking system, and we can also perform regeneration of content in parallel, IOW don’t re-invent what make can already do for us, it also helps in keeping things simple.

Architecture

Under db there are folders for posts, comments, and authors. Each file is in RFC822-style, that is, it starts with headers of the form «field»: «value» and then a blank line followed by the content.

There is a db-example folder with an example post and comment.

The main logic is in bin/gen_makefile. Run make in the root of this project, this will generate build/Makefile based on the posts/comments in db and it will also build the HTML versions in build/public.

If you change anything under db then run make again to get build/public updated. Hint: run make -j4 or set the MAKEFLAGS environment variable to -j4 if you want to run 4 parallel jobs at the time, while building.

The scripts to generate posts, the RSS feed, etc. are also under bin and called by the built Makefile. I suggest inspecting the built Makefile to see how dependencies are setup and how scripts are called etc.

Various things are presently hardcoded, e.g. blog title, the way templates are used, etc.

Posting Comments

Adding a comment is done by piping the comment to bin/new_comment. There is a PHP script under php which does exactly this (with the proper field values taken from the POST request).

Markdown

Put a symbolic link to Markdown.pl in bin.

WordPress Import

This requires a mysql driver for Ruby.