public
Description: Write entries in Maruku, track them with git, generate (X)HTML when you push.
Homepage:
Clone URL: git://github.com/bct/sloth-log.git
bct (author)
Sat May 16 18:42:16 -0700 2009
commit  ff0c1863ae4570d708fd1cb3d0bb43fb96ac375b
tree    783c7f7de657d00e69182a1f87a49f42b25f0f74
parent  04d02bec7ca3fce841d550472ecac0828f6a3dbd
name age message
file README.md Sat May 16 18:42:16 -0700 2009 cp a >b is silly :3 [bct]
directory bin/ Sat May 16 18:37:44 -0700 2009 added configuration files and instructions [bct]
file config.yaml Sat May 02 21:35:12 -0700 2009 reorganization, don't generate config.yaml [bct]
directory entries/ Sun Apr 26 00:54:49 -0700 2009 maruku -> atom [bct]
directory xsl/ Sat May 02 20:19:10 -0700 2009 archives [bct]
README.md

sloth-log

sloth-log is a Maruku -> Atom -> (X)HTML static file generator. It takes a directory full of Maruku files (or plain XML Atom entries), and turns them into something that you can dump onto a web server.

The idea is that you git clone this template repository and set up a hook so that when your new repository gets a commit or a push everything gets updated.

Requirements

  • atom-tools
  • maruku
  • ruby-xslt
  • a webserver that supports content negotiation

Setup

# make a new remote repository 'foo'
server$ mkdir foo; cd foo; git init

# add a remote repository named 'site' and push the basics to it
laptop$ git remote add site server:foo
laptop$ git push site master

# install the post-receive hook and configure sloth-log
server$ git checkout
server$ cp bin/post-update .git/hooks/
server$ $EDITOR config.yaml

# test the configuration
server$ ./bin/sloth
# check that it all went as expected
server$ git commit config.yaml

# add a new entry and publish it
laptop$ $EDITOR entries/hello-world; git commit
laptop$ git push site master

Content Negotiation

In order for any of the generated links to work, your server needs to support content negotiation for Atom and (X)HTML.

Conneg with Lighttpd

Lighttpd itself doesn't support content negotiation. It does support Lua though, and you can get conneg that way.

Michael Gorven has generously provided a script that is included with sloth-log. To install it, just copy bin/negotiate.lua somewhere and add this line to your lighttpd.conf:

magnet.attract-physical-path-to = ("somewhere/negotiate.lua")

Your /etc/mime.types should contain entries that map '.atom' => application/atom+xml and '.xhtml' => application/xhtml+xml.

There is another Lua Lighttpd content negotiation script that may be easier to set up and faster to respond; I haven't tried it.

Use

Add Maruku entries to ./entries (there should already be an example in there). When you're ready to publish, commit your changes and git push site.

If you don't want to deal with all of the post-update hook nonsense, you can just run ./bin/sloth to generate the HTML.