For some reason whenever I'm in a transitionary point in my life I end up rebuilding my website. Well, this time is no different: I recently quit my job, moved halfway across the world to Germany and, in the spare time between mountains of visa paperwork, have rebuilt my website once more.
Aside from a few UI tweaks (and probably bugs) it shouldn't look too different than it did before. The real change is what is generating the site: a shiny new Clojure-based static site generator I've named Jupi (pronounced HOO-pee, after our cat). I did this partly as a means to gain more experience with Clojure and partly out of frustration with some of the limitations I faced building the previous version of my site with Jekyll. For now, Jupi is pretty specialized to my use case, but here are a few interesting factoids about it:
- The HTML for pages can be generated using nothing but Clojure. I use hiccup to translate the data structures into HTML strings. See the source for the index page for an example.
- I wanted to experiment with how far I could get by using only Clojure, so even the CSS is generated with clj using garden. After a few weeks with this I've actually found that I like it more than writing SASS.
- It has the concept of "collections," similar to Jekyll's, however they're much more flexible and can be defined by anything from markdown files to JPEG files. See examples of my blog and photo galleries.
- I managed to get a REPL-based live-reloading workflow going using a highly savage macro that overloads
defn
. Is this a good idea? Maybe not. But it's undeniably an idea. - The photo gallery collection handles automatically resizing large photos into thumbnails which should make it much less work to add new galleries in the future.
- The flexibility of having a full programming language at my disposal to generate pages should allow for some fun experimentation. A couple ideas I'm currently floating around:
- Query my listening history from Plex at compile time and generate a last.fm-like page of my top albums for the month.
- Fetch posts from Mastodon and archive them on the site.
For those who are curious and want to poke around, I've released the source code on SourceHut. I'll likely have more to say on this in the future, as I have a growing desire to clean and package Jupi into a library that others can experiment with.