BLOOD CHURCH

by cassandra lugo // portfolio // resume // email // RSS

more blog tweaks

20240922

made some more blog improvements last night after the big move. big change to the layout is posts now have dates on them. the bigger technical change is the addition of a blogroll powered by openring.

openring is very simple and very cool. you give it a list of rss feeds, and it selects the most recent three posts from them and lets you use a template to generate some HTML highlighting them that you can then inject into your site via whatever static site generator you want.

wait how do i install openring openring doesn't seem to ship binaries, so you have to clone the repo:
git clone https://git.sr.ht/~sircmpwn/openring

and then make sure you have go installed and run

go build

in the openring directory.

i wrote a super simple shell script for this:

#!/bin/bash
#

openring \
    -s https://blog.lauramichet.com/feed \
    -s https://azhdarchid.com/feed \
    -s https://kimimithegameeatingshemonster.com/feed \
    -s https://buttondown.com/allstationsbeyond/rss \
    -s https://motd.co/feed/feed.xml \
    -s https://buttondown.com/HTHR/rss \
    -s https://ghoulnoise.com/feed/ \
    < ~/blog/assets/openring.html \
    > ~/blog/themes/blood/layouts/partials/footer.html

that i then added to my git post-receive hook to run before regenerating the site

#!/bin/bash

cd /home/cass/blog/
rm -rf public
source ~/blog/openring.sh
hugo

and it’s all automated.

i then killed two birds with one stone: i wanted to implement post scheduling, whcih you would think would be hard. nope, it’s super easy! all i needed was a cron job:

0 * * * * cd ~/blog/ && ./openring.sh && hugo

and now it will rebuild the site every hour, pulling in new posts for the blogroll alongside it. hugo doesn’t generate pages for content with post dates in the future, so if i want to schedule the post, all i need to do is set the post date to some time in the future, and it will publish it on the hour after the post date becomes the past. cool!

my next project is to try to implement hatsu, a thing my friend alex told me about that will let people follow my blog using activitypub.


blog web development programming