8c6794b6.github.io

Migrating to Coleslaw

Made updates to this gh-page. The site is still generated with static site generator, though the generator has changed from Hakyll to Coleslaw. The site uses hand-made scratchy CSS with color scheme borrowed from Solarized.

Coleslaw is a static site generator written in Common Lisp. As of the version included in Quicklisp 2016-12-08, Coleslaw supports plain HTML, Markdown and reStructuredText for writing contents. Basic usage of Coleslaw is written in README file. Coleslaw uses .coleslawrc file to configure the site. The configuration file could be placed under the user's home directory (i.e.: $HOME/.coleslawrc), or under the directory containing all the other files for building the site (e.g.: /path/to/my/site/.coleslawrc). It uses Common Lisp port of Closure Templates for defining theme templates. Markdown parser used by Coleslaw is 3bmd.

Coleslaw recommends the use of plugins to customize and extend the site. The archive page of this site and the pages showing the posts for each tag are built with simple plugins. Plugins are simply a Common Lisp source code, which should be a package with Coleslaw's naming convention. The naming convention is coleslaw-NAME_OF_PLUGIN, where NAME_OF_PLUGIN is name of the plugin (e.g.: Package name of the archive plugin is coleslaw-archive). Suppose that, the directory containing the static site is structured as below:

/path/to/my/site/
├── .coleslawrc
├── 404.page
├── about.page
├── plugins
│   ├── archive.lisp
│   └── tags.lisp
├── posts
│   ├── 2011-10-21-what-to-count-in-source-code.post
│   ├── ...
│   └── 2016-12-27-migrating-to-coleslaw.post
├── static
│   ├── bench-avl-insert-member.html
│   └── ...
├── the.archive
└── themes
    └── simple
        ├── archive.tmpl
        ├── base.tmpl
        ├── css
        │   └── style.css
        ├── index.tmpl
        ├── post.tmpl
        └── tag.tmpl

And the contents of .coleslawrc similar to below:

(:author "8c6794b6"
 :charset "UTF-8"
 :deploy-dir "/path/for/deploy/"
 :domain "http://my.url.com"
 :plugins ((mathjax)
           (static-pages)
           (sitemap)
           (archive)
           (tags))
 :routing ((:post           "posts/~a")
           (:tag-index      "tag/~a")
           (:month-index    "date/~a")
           (:numeric-index  "~d")
           (:feed           "~a.xml")
           (:tag-feed       "tag/~a.xml"))
 :staging-dir "/tmp/coleslaw-staging/"
 :title "8c6794b6.github.io"
 :theme "simple")

By evaluating (coleslaw:main #p"/path/to/my/site") in Common Lisp, coleslaw will generate the site contents. Some of the works done are:

For archive and tags plugins, which are made for this site, the source codes and templates are tightly coupled, so the plugins are not much reusable.

TAGGED: git, lisp, coleslaw, commonlisp, web