small protocols static generator
Now with more gopher and fewer lines of code.
Did a pretty hefty refactor of my static site generator spsg (previously known as gismo), to remove a bunch of duplicated code. As I transitioned from just gemini, to include gopher, then nex. I had done a bunch of lazy copy&pasting. Then I added generation for a second set of indexes for the `log` section which was about to be more duplication, so a clean up was in order.
Whilst in the weeds I also created a proper gophermap for the photolog, as before I only had a link to the photolog.gmi file. In total its now generating three unique pages, in three differnt formats (cheated a tiny bit with the nex photolog, that's just a symlink for now).
site root /
- index.gmi
- gophermap
- index
photo log /plog
- index.gmi
- gophermap
- index (symlinked to index.gmi)
sections
In my case, I have four sections. "log" is a special case as is not listed on the site index under sections, the rest are.
log /log
- index.gmi
- gophermap
- index
mysection one
- index.gmi
- gophermap
- index
mysection two (etc)
- index.gmi
- gophermap
- index
All sections posts, including the log are added to an atom.xml feed, and each are compliant with the geminifeed format. The photolog is still in tinylog format.
Source code on sr.ht
🏷 #log #staticsite #spsg #golang
Source