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

Trimming a Fake Object

A refactoring example. When I introduce the Fake Object testing pattern to people, a common concern is the maintenance burden of it. The point of the pattern is that you write some 'working' code only for test purposes. …

via ploeh blog November 20, 2023

Building a digital vigil for those we've lost

This post is hard to write in a lot of ways. It's more personal than most I've written. This is presumptively a tech blog, and this piece is about so much more than technology. But it's important. Making things, software or otherwise, is ultimatel…

via blog November 19, 2023

#122 Experimenting and Learning

Update on what happened across the GNOME project in the week from November 10 to November 17. GNOME Circle Apps and Libraries Workbench A sandbox to learn and prototype with GNOME technologies. Sonny says Workbench is a code playground and Library to learn, e…

via This Week in GNOME November 17, 2023

Generated by openring