Dhall Gemini Capsule Generator

Today I procrastinated my more important projects and duties to finally write a site generator for this capsule.

First I did a little research on Atom, and came across this gem on IndieWeb:

The RSS Atom wars (or syndication wars) were a toxic plumbing debate about the merits of using Atom vs RSS that dragged in and distracted numerous high level web technologists from 2003-2007 while social silos (Facebook, Flickr, Twitter, etc.) emerged, rapidly innovated UX, and thus gained popular adoption.

https://indieweb.org/RSS_Atom_wars

Right. Then I looked at the Atom format RFC.

https://datatracker.ietf.org/doc/html/rfc4287

I didn't have the patience to actually read it, so I looked at the example on page 3 and then wrote a Dhall type for that. Then wrote an XML generator.

https://git.sr.ht/~ehmry/dhall-atom

Dhall Atom

I recreated the example on page 3 and fed that into the W3C validator and with a few tweaks it passed. I can read the other 40 pages some other day.

https://validator.w3.org/feed/

Now I can start writing my generator. I import the Atom library and define my type for posts:

Fill out some Article records using "import … at Text" to read files into Text items:

Fill out an Atom.Feed.Type:

Generate a Molly-Brown configuration:

I interpolate the index.gmi text with links to the articles, and then generate a list of `{ mapKey : Text, mapValue : Text }` tuples that Dhall will translate into a directory of files. I prepend each text with a title that I define in my list of articles:

I run `dhall to-directory-tree` and then rsync the results to my server.

That's it.

The complete implementation is here:

generate-gemini.dhall

atom.feed

Validate my current feed

Proxied content from gemini://gemini.spam.works/users/emery/dhall-site-generator.gmi

Gemini request details:

Original URL
gemini://gemini.spam.works/users/emery/dhall-site-generator.gmi
Status code
Success
Meta
text/gemini
Proxied by
kineto

Be advised that no attempt was made to verify the remote SSL certificate.