Written: 2023-12-07
Revised: 2024-01-08
How this site is built
This gemlog/website is published simultaneously in the Web and on Gemini. It's quite interesting that what kept stopping me from writing in the first place was fiddling around too much with markup, and what led me to actually publish this was implementing the markup myself.
It is implemented by a pair of awk scripts, embedded in a shell script. It recursively traverses the current directory, converting any .gmi files to .html. It is surprisingly readable; the line-oriented nature of gemtext makes awk a nice fit.
A few other features include:
- automatically generating index.html for directories that don't have one
- basic navigation
- a very lightweight, but nice-looking, CSS3 stylesheet
- as a gemtext extension, footnotes actually look like footnotes
- table of contents generation
All this was implemented in an afternoon. It has since been expanded to generate atom feeds. Currently, it's about 270 LOC.
Here's a little test:
# Title
## Subtitle
### Sub-sub-title
=> https://example.com/ Link
Normal text!
In multiple lines!
Or a separate paragraph!
* also bullet points
* possibly several
> This is a blockquote.
> With multiple lines too.
--- me, today.
And footnotes[a]!
[a] Footnotes aren't actually gemtext, but since I use them all the time, here they are[b].
[b] No recursive footnotes[c] though. They show as normal text. Bet you wouldn't have noticed.
[c] See [d].
[d] See [c].
That's about it. Here's how it looks:
Title
Subtitle
Sub-sub-title
Link
Normal text!
In multiple lines!
Or a separate paragraph!
- also bullet points
- possibly several
This is a blockquote.
With multiple lines too.
— me, today.
And footnotes[a]!
[a] Footnotes aren't actually gemtext, but since I use them all the time, here they are[b].
[b] No recursive footnotes[c] though. They show as normal text. Bet you wouldn't have noticed.
[c] See [d].
[d] See [c].