This website now has a Webring

Today the small chat I’m part of had a brief talk about Webrings due to this Lobsters discussion. Well, I always wanted to do something about my blogroll and its interaction with this same website. Previously I had a page that was rendered as a regular web page but… I don’t know… it just wasn’t cool enough!

After the brief conversation about Webrings I thought: “Why not add OPML support to Drew Devault’s openring tool?”. And that’s exactly what I did on my own fork. You can now pass a -O opml-file.xml flag and have it fetch the feeds from the OPML file.

Setting it up on Hugo

I have a quite unconventional Hugo setup, here is how I made openring work with it. First, I added an empty layouts/partials/webring.html file. Why? This way I can run hugo serve locally without having to run openring to generate the file.

Then I added the Webring partial to the end of my single.html layout. I decided that people would be more likely to see the articles when reading a blog post of mine than scrolling through the post list.

  <!-- ... -->
  {{ partial "webring" . }}
{{ end }}

Now, I have to generate the actual webring.html file during the build/publishing of my website. I did this by adding the following target and dependencies on my Makefile:

# ...
content: $(SOURCES)
	emacs $(pwd) --batch -load export.el

public: content layouts/partials/webring.html
.PHONY: layouts/partials/webring.html
	$(OPENRING) -O assets/blogroll.xml < static/openring-in.html > $@

I made the webring.html be a PHONY target because I wanted to regenerate it every time I ran the public target.

That’s all I needed to do to add the Webring you are seeing below this post!

Articles from blogs I follow around the net

Variations of the Range kata

In the languages I usually employ. The Range kata is succinct, bordering on the spartan in both description and requirements. To be honest, it's hardly the most inspiring kata available, and yet it may help showcase a few in…

via ploeh blog January 1, 2024

Some notes on NixOS

Hello! Over the holidays I decided it might be fun to run NixOS on one of my servers, as part of my continuing experiments with Nix. My motivation for this was that previously I was using Ansible to provision the server, but then I’d ad hoc installed a bunch…

via Julia Evans January 1, 2024

I found some of my first code! Annotating and reflecting on robotics code from 2009.

In high school, one of my teachers shattered my plans for my life, in the most beautiful way. Most of my life, I'd intended to become a math professional of some sort: a math teacher, when that was all I saw math for; an actuary, when I started to lear…

via blog January 1, 2024

Generated by openring