2012-08-26 14:48:23 -04:00
# coleslaw
2012-09-20 18:33:29 -04:00
< img src = "https://raw.github.com/redline6561/coleslaw/master/themes/hyde/css/logo_medium.jpg" alt = "coleslaw logo" align = "right" / >
2011-04-16 15:45:37 -04:00
2012-08-29 14:58:49 -04:00
> [Czeslaw Milosz](http://blog.redlinernotes.com/tag/milosz.html) was the writer-in-residence at UNC c. 1992.
> I used to see him all the time at the Hardback Cafe, always sitting at a two-top
> drinking coffee, reading, writing, eating chips and salsa. I remember a gentleness
> behind the enormous bushy eyebrows and that we called him Coleslaw. - anon
Coleslaw aims to be flexible blog software suitable for replacing a single-user static site compiler such as Jekyll.
## Features
2012-08-19 00:29:44 -04:00
* Git for storage
2012-12-11 10:11:39 -05:00
* RSS and Atom feeds!
2012-08-26 23:30:41 -04:00
* Markdown Support with Code Highlighting provided by [colorize ](http://www.cliki.net/colorize ).
2012-11-28 16:56:42 -05:00
* Currently supports: Common Lisp, Emacs Lisp, Scheme, C, C++, Java, Python, Erlang, Haskell, Obj-C, Diff.
2013-01-01 18:18:11 -05:00
* [Multi-site publishing ](http://blub.co.za/posts/Adding-multi-site-support-to-Coleslaw.html ) support.
2012-11-28 16:56:42 -05:00
* Plugins for...
* Comments via Disqus
2013-01-14 12:29:28 -05:00
* Analytics via Google
2012-11-28 16:56:42 -05:00
* Using LaTeX (inside pairs of $$) via Mathjax
* Importing posts from wordpress
2012-09-14 17:29:34 -04:00
* There is also a [Heroku buildpack ](https://github.com/jsmpereira/coleslaw-heroku ) maintained by Jose Pereira.
2012-11-28 16:56:42 -05:00
* Example sites: [redlinernotes ](http://redlinernotes.com/blog/ ) and [(lisp :is 'fun) ](http://blub.co.za/ ).
2012-08-19 00:29:44 -04:00
2012-08-29 14:58:49 -04:00
## Installation
2012-08-22 10:05:02 -04:00
This software should be portable to any conforming Common Lisp implementation but this guide will assume SBCL is installed. Testing has also been done on CCL.
Server side setup:
2012-08-26 14:48:23 -04:00
2012-08-26 14:41:32 -04:00
1. Setup git and create a bare repo as shown [here ](http://git-scm.com/book/en/Git-on-the-Server-Setting-Up-the-Server ).
2012-09-04 22:06:57 -04:00
2. Install Lisp and [Quicklisp ](http://quicklisp.org/ ).
2013-01-03 11:12:42 -05:00
3. ```wget -c https://raw.github.com/redline6561/coleslaw/master/examples/single-site.coleslawrc -O ~/.coleslawrc` `` # and edit as necessary
2013-01-12 10:58:26 -05:00
4. ```wget -c https://raw.github.com/redline6561/coleslaw/master/examples/example.post-receive -O your-blog.git/hooks/post-receive` `` # and edit as necessary
2012-09-04 22:06:57 -04:00
5. ```chmod +x your-blog/.git/hooks/post-receive` ``
6. Create or clone your blog repo locally. Add your server as a remote with ```git remote add prod git@my-host.com:path/to/repo.git` ``
7. Point the web server of your choice at the symlink /path/to/deploy-dir/.curr/
2012-08-26 14:48:23 -04:00
2012-08-26 14:41:32 -04:00
Now whenever you push a new commit to the server, coleslaw will update your blog automatically! You may need to git push -u prod master the first time.
2012-08-29 14:58:49 -04:00
## The Post Format
2012-08-26 14:41:32 -04:00
Coleslaw expects post files to be formatted as follows:
```
;;;;;
title: foo
tags: bar, baz
2012-09-20 18:33:29 -04:00
date: yyyy-mm-dd hh:mm:ss
2012-08-26 14:41:32 -04:00
format: html (for raw html) or md (for markdown)
;;;;;
your post
```
2012-08-29 14:58:49 -04:00
## Importing from Wordpress
2012-08-26 14:41:32 -04:00
There is a "plugin" to import from wordpress. At some point, it should be turned into a standalone script. Until then...
2012-08-26 14:48:23 -04:00
2012-08-26 14:41:32 -04:00
1. Export your posts from wordpress.
2. In your lisp of choice, do the following:
1. ```(ql:quickload 'coleslaw)` ``
2. ```(in-package :coleslaw)` ``
3. ```(load-plugins '(import))` ``
4. ```(coleslaw-import::import-posts "/path/to/export.xml")` ``
2012-08-26 14:48:23 -04:00
2013-01-03 11:12:42 -05:00
The XML will be read and placed into .post files in the :repo location specified in your [.coleslawrc ](http://github.com/redline6561/coleslaw/blob/master/examples/single-site.coleslawrc ).
2012-08-26 14:41:32 -04:00
2012-08-29 14:58:49 -04:00
## Writing your own plugins
For now, see the [API ](http://redlinernotes.com/docs/coleslaw.html ) and the [mathjax plugin ](https://github.com/redline6561/coleslaw/blob/master/plugins/mathjax.lisp ) for an example.
A proper guide about this will be written later.
2012-08-26 14:44:36 -04:00
2012-08-29 14:58:49 -04:00
## Theming
2012-08-26 14:44:36 -04:00
A default theme, hyde, is provided. Themes are made using Google's closure-template and the source for [hyde ](https://github.com/redline6561/coleslaw/tree/master/themes/hyde ) should be simple and instructive until I can provide better docs.