This Blog Is Now Haunted 👻

image

And perfect timing for October! 🎃

Since I've started this blog I've been more and more intrigued by GNU Guix, Guile Scheme and LISP dialects in general. It then seemed only fitting that when I found the awesome looking project, Haunt, I had to try it out.

Haunt is a static website generator, just like Hugo (that I used previously), but written entirely in Guile Scheme. You define your entire website just as you would a scheme program. For example, this blog is defined (partly) like this:

(use-modules (haunt asset)
             (haunt builder blog)
             (haunt builder atom)
             (haunt builder assets)
             (haunt builder flat-pages)
             (haunt builder redirects)
             (haunt reader commonmark)
             (haunt post)
             (haunt site)
             (grop.dev theme)
             ((grop.dev redirects) #:prefix grop:)
             (grop.dev commonmark))

(define post-prefix "/posts")

(define collections
  `(("Posts" "posts.html" ,posts/reverse-chronological)))

(site #:title "grop.dev"
      #:domain "grop.dev"
      #:default-metadata
      '((author . "Gunnar Grop")
        (email  . "gunnar.grop@protonmail.com"))
      #:readers (list commonmark-reader*)
      #:builders (list (blog #:theme grop-theme
                             #:collections collections
                             #:post-prefix post-prefix)
                       (redirects grop:redirects)
                       (atom-feed #:blog-prefix post-prefix
                                  #:file-name "posts/index.xml")
                       (atom-feeds-by-tag #:blog-prefix post-prefix)
                       (flat-pages "pages"
                                   #:template flat-page-template)
                       (static-directory "css")
                       (static-directory "assets/images")
                       (static-directory "assets/text")))

Thus far I really like it. It's much harder to get started with, compared to Hugo, if you don't already have experience with Guile Scheme. But, at the same time it's much simpler. I also really like that you can define HTML (really XML) with S-expressions using SXML.

Unfortunately I've had to sacrifice some things, like a nice Tags page, and syntax highlighting for YAML snippets. But I'm sure I'll even out these drawbacks in the near future. I'm here mostly to learn scheme anyway.

So, for the foreseeable future I'll keep using Haunt. I recommend you do to, if you're looking for a simple but very cool static website generator.

Big thanks to David Thompson for creating Haunt.