hugo/markup/gemtext
Erica Z 4d028fd20e Fix up the gemtext README 2021-10-18 19:28:26 +02:00
..
standalone Implement the gemtext to HTML converter, along with a standalone executable 2021-10-18 18:11:53 +02:00
README.md Fix up the gemtext README 2021-10-18 19:28:26 +02:00
convert.go Implement the gemtext to HTML converter, along with a standalone executable 2021-10-18 18:11:53 +02:00

README.md

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, where br is used to separate them
  • figure for preformatted lines, where the actual preformatted contents are inside a pre tag, and the alt text, if present, is inside a figcaption
  • blockquote for any sequence of quote lines
  • h1, h2 and h3 for heading lines
  • ul for both link lines and unordered list items:
    • Any sequence of non-empty link lines is output as a ul element with the links class, where each item is an a element prepended by a li tag
    • Any sequence of non-empty unordered list items is output as a ul element with the items class, where each item is text prepended by a li tag

For convenience in testing, a standalone version of the converter is provided here.