From 2ab0e23eca3c5cac82d948e506b3f1cb81bedd18 Mon Sep 17 00:00:00 2001 From: t Date: Sat, 11 Jul 2026 12:08:14 -0600 Subject: Migrate site pages to Weft templates and Markdown --- weblog/_moving-off-gemini.html | 88 ------------------------------------------ weblog/_moving-off-gemini.md | 46 ++++++++++++++++++++++ weblog/index.html | 13 +++---- weblog/index.html.tmpl | 27 +++++++++++++ 4 files changed, 79 insertions(+), 95 deletions(-) delete mode 100644 weblog/_moving-off-gemini.html create mode 100644 weblog/_moving-off-gemini.md create mode 100644 weblog/index.html.tmpl (limited to 'weblog') diff --git a/weblog/_moving-off-gemini.html b/weblog/_moving-off-gemini.html deleted file mode 100644 index fdf6165..0000000 --- a/weblog/_moving-off-gemini.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - -Moving my weblog off Gemini (without leaving it) — tjp.lol - - - - - -
- -
-

~tjp $_

- -
- -
-
-
-

← weblog  / 

-

Moving my weblog off Gemini (without leaving it)

-
- -

This is placeholder text laid out so you can see how a full post reads. Replace it with the real .gmi content when you export the capsule — the structure below covers everything a converted Gemini post will need: headings, lists, quotes, code, and links.

- -

I've kept a capsule at gemini://gemini.ctrl-c.club/~tjp/ for a few years now. Gemini is a lovely place to write: the format is so constrained that there's nothing to fiddle with, and the whole thing rewards plain, linear prose. But I wanted a web presence too — one that fits in with the personal sites I keep finding in webrings.

- -

The plan

-

The goal was never to abandon geminispace. It was to have both, from one source of truth. Gemtext is close enough to Markdown that a small converter gets you most of the way there:

- -
    -
  • Keep writing .gmi files in my capsule.
  • -
  • Run a converter that emits HTML with the same structure.
  • -
  • Wrap each page in the site template you're reading now.
  • -
- -

The converter

-

Gemtext has exactly one block-level construct per line, which makes parsing almost insultingly simple. Here's the core of it:

- -
while IFS= read -r line; do
-  case "$line" in
-    "### "*) echo "<h3>${line#### }</h3>" ;;
-    "## "*)  echo "<h2>${line### }</h2>" ;;
-    "# "*)   echo "<h1>${line## }</h1>" ;;
-    "=> "*)  emit_link "$line" ;;
-    "* "*)   emit_list_item "$line" ;;
-    "> "*)   echo "<blockquote>${line#> }</blockquote>" ;;
-    "")      echo "" ;;
-    *)       echo "<p>$line</p>" ;;
-  esac
-done < "$1"
- -

That's genuinely most of it. The fiddly parts are link lines (=> can be a bare URL or have link text) and collapsing runs of * lines into a single <ul>.

- -
The best format is the one that outlives the tool you wrote it in. Gemtext will still be readable when this converter is long gone.
- -

What I kept

-

No client-side anything. The web version renders identically with JavaScript disabled, because there is no JavaScript to disable. Fonts are whatever your system already has. The whole page is a few kilobytes.

- -

If you want the source, it lives with the rest of my projects. And the capsule is still there — see the colophon for how it all fits together.

-
- - -
- - - -
- - diff --git a/weblog/_moving-off-gemini.md b/weblog/_moving-off-gemini.md new file mode 100644 index 0000000..e0cafe0 --- /dev/null +++ b/weblog/_moving-off-gemini.md @@ -0,0 +1,46 @@ +--- +post_date: 2026-06-30 +description: How I mirror my Gemini capsule to the web without abandoning geminispace. +--- +# Moving my weblog off Gemini (without leaving it) + +*This is placeholder text laid out so you can see how a full post reads. Replace it with the real `.gmi` content when you export the capsule — the structure below covers everything a converted Gemini post will need: headings, lists, quotes, code, and links.* + +I've kept a capsule at `gemini://gemini.ctrl-c.club/~tjp/` for a few years now. Gemini is a lovely place to write: the format is so constrained that there's nothing to fiddle with, and the whole thing rewards plain, linear prose. But I wanted a web presence too — one that fits in with the personal sites I keep finding in webrings. + +## The plan + +The goal was never to abandon geminispace. It was to have both, from one source of truth. Gemtext is close enough to Markdown that a small converter gets you most of the way there: + +- Keep writing `.gmi` files in my capsule. +- Run a converter that emits HTML with the same structure. +- Wrap each page in the site template you're reading now. + +## The converter + +Gemtext has exactly one block-level construct per line, which makes parsing almost insultingly simple. Here's the core of it: + +```sh +while IFS= read -r line; do + case "$line" in + "### "*) echo "

${line#### }

" ;; + "## "*) echo "

${line### }

" ;; + "# "*) echo "

${line## }

" ;; + "=> "*) emit_link "$line" ;; + "* "*) emit_list_item "$line" ;; + "> "*) echo "
${line#> }
" ;; + "") echo "" ;; + *) echo "

$line

" ;; + esac +done < "$1" +``` + +That's genuinely most of it. The fiddly parts are link lines (`=>` can be a bare URL or have link text) and collapsing runs of `* ` lines into a single `