An introduction to CL-BLOGGY

Blogging with CL-BLOGGY

22nd of August 2021 at 01:12am SAST

Okay, lets write an introduction to how you setup and use cl-bloggy.


CL-BLOGGY is a Common Lisp library that allows you to live code entries into your blog. It is designed to be highly extensible; the majority of the functionality has been implemented using Generic Functions, this means that as a user you can customize the behaviour of most of the system, although I imagine you would primarily be interested in customizing its appearance. By utilizing the CLOS I have created a webpage generator that allows the user to fully customize the appearance and the layout of their own blog. By writing a Lisp form you are able to produce a nicely formatted and ready to go blog post in your own instance of CL-BLOGGY.
At the time of writing this library handles the following:
List of cool things:
  1. Creation of blog posts.
  2. Deletion of blog posts.
  3. Direct links to posts (obviously)
  4. Ordering of posts by date.
  5. Ordering by date within an index.
  6. Ordering of posts by categories
  7. Nesting of categories, ie each category is a child of the former 'general <- programming <- common lisp <- cl-bloggy', a category can only have one parent but many children
  8. Creation of a primary RSS feed at (format stream "~A/rss.xml" (url (blog <acceptor>))
  9. Creation of category based RSS feeds at (format stream "~A/~A/rss.xml" (url (blog <acceptor)) (url category))
  10. Customizing the layout of the blog, entry and index using generic functions.
  11. Minimalist CSS, currently 3 external style sheets are imported by default:, normalize.css, and Google's Roboto font (required for Milligram)
  12. Customizing the colour scheme of the blog, entry and index using generic functions.
  13. A simple 4 palette colour scheme using both CSS and Common Lisp global variables for easy theming
  14. Sane but currently as of the date of this article, changing default CSS.


The goal of the library is to allow a Common Lisp user to setup their own blog, on their own VPS where they can create and manage entries with ease. It's designed to be highly extensible, what is the point writing it in CL if it isn't built this way? It is designed to be open to the programmer, each object in the system has access to the others, even the instances of blog instantiated for rendering categories are aware of the top level blog. The library has been designed this way because it allows an experienced Lisper to customize the blogging system however they want. The code should also be easyish to understand, I know that every Lisp programmer has their own programming style, but my intention with this library is for it to be reasonably readable with minimal use of macros, so code readability over macrology
Programs must be written for people to read, and only incidentally for machines to execute. - Abelson & Sussman, in the preface to the first edition of SICP.