1.1 KiB
1.1 KiB
Gemtext in Hugo
This patch implements gemtext (text/gemini, .gmi) as a content language for Hugo. This effectively lets you write pages in gemtext instead of Markdown, including front matter support and an (opinionated) converter to HTML.
HTML conversion
The HTML converter (implemented here) generates the following elements:
p
for any sequence of non-empty text lines, wherebr
is used to separate themfigure
for preformatted lines, where the actual preformatted contents are inside apre
tag, and the alt text, if present, is inside afigcaption
blockquote
for any sequence of quote linesh1
,h2
andh3
for heading linesul
for both link lines and unordered list items:- Any sequence of non-empty link lines is output as a
ul
element with thelinks
class, where each item is ana
element prepended by ali
tag - Any sequence of non-empty unordered list items is output as a
ul
element with theitems
class, where each item is text prepended by ali
tag
- Any sequence of non-empty link lines is output as a
For convenience in testing, a standalone version of the converter is provided here.