okay so i got up to some bullshit while writing this, so listen up.
I'm still using the "blog" and "journal" formats from miso.town for writing the blog and the journal.
<https://blog.miso.town/>
<https://journal.miso.town/>
But I grew unsatisfied using them to auto-generate the rss feeds.
Primarily because it couldn't handle the "~/dozens" part of my base "https://tilde.town/~dozens/clericthief" URL. And also because it included a lot of auxilary HTML elements like the navbar.
So I decided I needed to roll my own feed generators.
I discovered a clever way to use ed.
You can wrap a file in ed commands like so:
```
echo i | cat - file.txt commands.ed | ed -s
```
where `i` is the ed command for insert.
The contents of your file, `file.txt` follow.
Make the first ed command in `commands.ed` a `.` to stop insert mode.
And then all your other ed commands can follow.
`ed -s` starts ed in silent mode.
If you end your list of commands with `1,$w /dev/stdout` then you can pipe the output to something else.
Neat!
So what I had was some very lightly structured text.
I decided the easiest thing to do would be to isolate the list of blog entries, and then format them as recfiles, which was pretty easy.
Here's my index.md at the time of this writing:
```
---
title: "Cleric + Thief"
subtitle: Adventures of Iofi and Maddox
created: 2022-08-30
updated: 2022-09-01
---
[subscribe to episodes](episodes.xml)
<!-- BEGIN //-->
-<time>2022-09-03</time> - [00003. The Hand](00003-hand.html)
There are m4 macros on lines 04 and 08 to insert the correctly formatted time, and to include the markdown content, respectively.
You can see the whole thing in the justfile, but the gist to get each rss item is:
```
echo i | cat - src/index.md ed/blogcommands.ed | ed -s | recfmt -f templates/blogitem.template | m4
```
The process for the journal entries is basically the same, with a little extra search and replace funny business in ed since the whole thing is one flat document.
The thing that really made all this work was the rec format. It made it super easy to format the data.