💾 Archived View for tilde.town › ~hush › gemlog › 2024-05-11.gmi captured on 2024-05-26 at 15:00:52. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2024-05-12)
-=-=-=-=-=-=-
It took surprisingly little effort to alter the tools I use to build my gemlog feed so that I can serve the atom feed over HTTP.
The goal was this: I wanted to symlink index.xml so that it could be linked both from the HTTP server and Gemini server here in ~town. The goal, then, was that the feed would contain the content from each of the posts, so that they could be rendered by RSS readers. I've been using nytpu's gemlog.sh to generate my feed, which does not, by default, include content. Since these are Gemini links, even if I serve the feed over HTTP, RSS readers have no content to display and links that they aren't capable of opening.
https://git.sr.ht/~nytpu/gemlog.sh
In order to augment the feed with content, I was going to need to convert the content of the posts to HTML. Since gemlog.sh is a bash script, I wanted something I could call from within it that would output the HTML to stdout. I went to kr1sp1n's awesome-gemini page and found this handy sed script:
kr1sp1n's awesome-gemini on codeberg
I made some small edits to the sed script to remove unneeded HTML wrappers, then added a couple lines to gemlog.sh to call the sed script on each file and sandwich it's output between <content></content> wrappers. The final step was to create a couple of symbolic links from the http server file to the gemini server, first for the feed file itself, and secondly for the images folder, so that RSS readers can open any image links in the gemini documents.
Perhaps a future step would be to alter the sed script so that if the link is to the images folder, it instead inlines the image?