Activity

Talking to the Wayback Machine

Way back in 2016, I migrated this site from its Publify incarnation to a static site generated from markdown files by Hugo. In that migration, I fucked up and truncated a buttload of posts and didn’t realise what I’d done until long after (about a week ago now) I had misplaced the database that the site had originally been generated from. Oops.

However, the Internet is still a marvellous place, blessed with useful sites like The Wayback Machine, which lets the interested reader browse historic versions of web pages. Which means, provided a page got noticed by archive.org’s crawlers, I can fetch a page from back before I fucked up and, with a little bit of massaging, turn it into something that Hugo can understand and get the whole article back again.

  • 2 likes
  • 1 repost
  • 0 replies
  • 1 mention

Written by Piers Cawley , updated

Read more…

@09:59

For… reasons, I found myself trawling back through the early entries here and found that a bunch of them had been truncated at some point in the blog’s history of migrating from engine to engine. Luckily, the Wayback Machine has a sufficiently complete archive, so I’m slowly working my way through the broken posts, bringing them into the big old Content.org file that the site’s generated from and adding a margin note or two to supply a bit of 2025 context where appropriate. The Fine Art of Complexity Management is the first post to receive such attention. Twenty two years on, I still think it’s good advice.

  • 0 likes
  • 0 reposts
  • 0 replies
  • 0 mentions

@14:07

Further to my last note, I think I might have a working script to send webmentions for any updated pages. Now to plumb it into the rest of the automation!

#!/usr/bin/env emacs -script is a powerful drug!

  • 0 likes
  • 0 reposts
  • 0 replies
  • 0 mentions

@08:25

Now I can display received Webmentions, I need to start working on sending them.

I don’t want to rely on an external service if I can help it, because that’s how my old setup decayed, so don’t hold your breath.

But the output of rsync --itemize-changes ... is looking tasty as a mechanism for spotting which URLs have changed between deployment runs.

Time to start experimenting.

Hmm… the first experiment doesn’t look too promising.

  • 0 likes
  • 0 reposts
  • 1 reply
  • 1 mention

@06:40

Oh! The reason Hugo didn’t load data/mentions.json was that the directory data/mentions/ exists!

Moved the webmentions data to data/webmentions.json and all is fine.

  • 1 like
  • 0 reposts
  • 0 replies
  • 0 mentions

Making use of Webmentions

In which we finish with Webmentions for the time being by massaging a flat list of mentions into a two-level hash table/JSON object that’s easy to make use of in Hugo.

And speculate about how we could improve things further, because things can always be improved.

  • 1 like
  • 0 reposts
  • 0 replies
  • 1 mention

Written by Piers Cawley , updated

Read more…

@07:51

Progress!

Before:

./data/mentions/3f256ff[...]494.json
./data/mentions/62afe34[...]020.json
...

Hmm, so which file pertains to which post?

{{ $slug := .RelPermalink | sha256 }}
{{ $all_mentions := index site.Data.mentions $slug | default slice }}
{{ $likes := where $all_mentions "wm-property" "like-of" }}

At least the template code to get at it is more or less sane.

During:

./data/mentions/note/8/mentions.json
./data/mentions/note/9/mentions.json

Well, that’s clear as day!

{{ $key := (split path.Dir .RelPermalink) "/" | after 1 | append "mentions" }}
{{ $all_mentions := index site.Data.mentions $key | default slice }}
{{ $likes := where $all_mentions "wm-property" "like-of" }}

What the actual fuck? I want to write {{ index site.Data.mentions .RelPermalink }} and have done with it. To the data mungery!

Now

./data/mentions/all.json

That’s a tad more opaque, isn’t it? Ah well, there’s always jq. I can’t see what’s got new mentions from git status any more, but also, I can’t forget to add any new data files either. Call it a win on aggregate.

{{ $all_mentions = index site.Data.mentions.all .RelPermalink | default dict }}
{{ $likes := index $all_mentions "like-of" | default slice }}

Well structured data for the win! And I’m working on eliminating the annoying default dict and default slice in that too.

  • 1 like
  • 0 reposts
  • 0 replies
  • 2 mentions

Picks and Shovels, by Cory Doctorow

The cover of Picks and Shovels, by Cory Doctorow

Cory Doctorow has an axe to grind.

Cory always has an axe to grind, of course, but since the upshot of that is books like Picks and Shovels, then I’m okay with that.

This is the third Marty Hench thriller and it’s a cracking read

  • 3 likes
  • 0 reposts
  • 0 replies
  • 1 mention

Written by Piers Cawley , updated

Read more…

@07:27

The pull of “One Big Text File” is strong

I’m semi-seriously contemplating pulling the Hugo theme that I use to generate this website into a single Org file and using Org’s Literate Programming tooling to spit it out into individual layout files.

I may need an intervention.

  • 3 likes
  • 0 reposts
  • 0 replies
  • 0 mentions

@09:22

Yay! Kicking it old school with a Makefile to automate building and deploying this site. I don’t know if I can entrust it to a cron job yet because the deployment involves ssh, and I’m a bit fuzzy on the workings of key management in such circumstances

  • 1 like
  • 0 reposts
  • 0 replies
  • 0 mentions

@02:11

I think I have webmentions displaying correctly again. However, we’re updating everything manually again at the moment, at least until I get a webhook up and running again, so it might take a while for your replies, reposts &c. to show up on the site.

Still, it does appear to be working again.

  • 2 likes
  • 0 reposts
  • 0 replies
  • 0 mentions

@17:33

This is absolutely what a sane person might write in their blog, isn’t it?

#+begin_example
,#+begin_src emacs-lisp :tangle nil :noweb-ref bibble
#+end_example
#+begin_src emacs-lisp
(setq some-variable 'some-value)
#+end_src
#+begin_example
,#+end_src
#+end_example

And then doing this to their CSS to make it work

.highlight+.highlight {
    margin-top: 0;
}

I’m going to hell, aren’t I?

For bonus points, see if you can work out what’s actually written in the source file for this note.

  • 1 like
  • 0 reposts
  • 2 replies
  • 0 mentions

@09:00

I really should get around to replacing bloody GitHub.

God help me if I end up self-hosting my own instance of some code forge, but AI bollocks can fuck right off. I keep hoping that people are going to wake up and realise it’s the very worst kind of emperor’s new clothes bullshit, but they’re taking their own sweet time about it.

  • 0 likes
  • 0 reposts
  • 0 replies
  • 0 mentions