Muto - Blog - Feed


Get Spooked

(Note, I have once again changed my website's generator. This time I'm using Weblorg! Spook may not be very well maintained anymore)

I've been writing a lot of SXML lately. It's pretty cool! Over the past few days I've been hacking up a little static website generator called Spook Earlier today I completely migrated my website from David's Haunt generator to Spook. I made website generators in the past, but Spook is special to me, so I want to talk a bit about it.


Simple Design

Spook reads a directory of SXML files, and converts them to HTML. Then it puts the HTML pages in a new directory that you can copy to your webserver's root. Spook comes with the tools required to make a blog listing, as well.

Although I want Spook to be hackable, I want the "hacking" part to be optional. At the time of writing I still need to perform some interface programming in order to make Spook more intuitive, but it's working well so far.


Easy to Start

Spook comes with a template that you can build on, minimizing the amount of guesswork you need to do after downloading. Simply edit the spook.scm template file and the page files in the page/ directory, and run main.scm to generate your site in a new folder named site/!

Spook uses Guile's SXML functionality for page creation. SXML is essentially HTML, so if you know HTML, SXML will be very easy!


Everything I Need

I don't know about what you need in a blog generator, but it serves it's purpose for me. Just take a look at this example page:

(page
 :title "This is a Page!"
 :date "Jan 1, 1970" ; Optional
 :style "body {background: lightblue;}" ; Optional
 :body
 `((p "Hello, world!")
   (p "How are you today?")))

As you can see, DATE and STYLE can be ommitted entirely. You only really need a date for blog posts, not for regular pages, and you rarely ever need an inline stylesheet (since you can define an external stylesheet in spook.scm)!

Of course, sometimes you want to re-style a webpage. For example, most of the items in my Projects directory have custom stylesheets in them, for marketing purposes.


As Many Blogs As You Want

With Spook, you can define multiple blog directories. For example:

(blog
 :title "First Blog"
 :msg   "Recent Posts"
 :path  "blog/")

(blog
 :title "Projects"
 :msg   "My Projects"
 :path  "projects/")

(blog
 :title "Random Things"
 :path "things/")

This will generate site/blog/index.html, site/projects/index.html, and site/things/index.html.

The msg key is an H2 element above the list of posts. "Random Things" does not specify a message and therefor Spook will not include one in the index file.

I think it's handy to be able to do this. For example, I want to list out all my blog posts, and also list all my software projects, so that's how I do it!