diff options
| author | t <t@tjp.lol> | 2026-07-11 12:08:14 -0600 |
|---|---|---|
| committer | t <t@tjp.lol> | 2026-07-11 12:10:15 -0600 |
| commit | 2ab0e23eca3c5cac82d948e506b3f1cb81bedd18 (patch) | |
| tree | 46dc28dcea6265ece0f4763cdff372f84578e172 /weblog | |
| parent | 9faffbf6bc5083239d69a2daedac273e6d814bc3 (diff) | |
Migrate site pages to Weft templates and Markdown
Diffstat (limited to 'weblog')
| -rw-r--r-- | weblog/_moving-off-gemini.html | 88 | ||||
| -rw-r--r-- | weblog/_moving-off-gemini.md | 46 | ||||
| -rw-r--r-- | weblog/index.html | 13 | ||||
| -rw-r--r-- | weblog/index.html.tmpl | 27 |
4 files changed, 79 insertions, 95 deletions
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 @@ -<!DOCTYPE html> -<html lang="en"> -<head> -<meta charset="utf-8"> -<meta name="viewport" content="width=device-width, initial-scale=1"> -<title>Moving my weblog off Gemini (without leaving it) — tjp.lol</title> -<meta name="description" content="How I mirror my Gemini capsule to the web without abandoning geminispace."> -<link rel="stylesheet" href="../style.css"> -<link rel="alternate" type="application/atom+xml" title="tjp.lol" href="../feed.xml"> -</head> -<body> -<div class="wrap"> - - <header class="site"> - <h1 class="brand"><a href="../index.html">~tjp<span class="cur"> $_</span></a></h1> - <nav class="main"> - <a href="../weblog/index.html" aria-current="page">weblog</a> - <a href="../notes/index.html">notes</a> - <a href="../projects/index.html">projects</a> - <a href="../about/index.html">about</a> - <a href="../feed.xml">rss</a> - </nav> - </header> - - <main> - <article class="post"> - <div class="post-head"> - <p class="meta"><a href="../weblog/index.html" style="text-decoration:none;">← weblog</a> / <time datetime="2026-06-30">2026-06-30</time></p> - <h1>Moving my weblog off Gemini (without leaving it)</h1> - </div> - - <p><em>This is placeholder text laid out so you can see how a full post reads. Replace it with the real <span class="mono">.gmi</span> content when you export the capsule — the structure below covers everything a converted Gemini post will need: headings, lists, quotes, code, and links.</em></p> - - <p>I've kept a capsule at <code>gemini://gemini.ctrl-c.club/~tjp/</code> 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.</p> - - <h2>The plan</h2> - <p>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:</p> - - <ul> - <li>Keep writing <code>.gmi</code> files in my capsule.</li> - <li>Run a converter that emits HTML with the same structure.</li> - <li>Wrap each page in the site template you're reading now.</li> - </ul> - - <h2>The converter</h2> - <p>Gemtext has exactly one block-level construct per line, which makes parsing almost insultingly simple. Here's the core of it:</p> - - <pre><code>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"</code></pre> - - <p>That's genuinely most of it. The fiddly parts are link lines (<code>=></code> can be a bare URL or have link text) and collapsing runs of <code>* </code> lines into a single <code><ul></code>.</p> - - <blockquote>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.</blockquote> - - <h2>What I kept</h2> - <p>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.</p> - - <p>If you want the source, it lives with the rest of my <a href="../projects/index.html">projects</a>. And the capsule is still there — see the <a href="../about/index.html">colophon</a> for how it all fits together.</p> - </article> - - <nav class="post-nav"> - <a href="../weblog/index.html">← Older</a> - <a href="../weblog/index.html">All posts</a> - <a href="../weblog/index.html">Newer →</a> - </nav> - </main> - - <footer> - <div class="ring"> - <span>webring:</span> - <a href="#">← prev</a><a href="#">rand</a><a href="#">next →</a> - </div> - <p>hand-written in slc · ©2026 tjp · content <a href="../about/index.html">CC BY 4.0</a> · <a href="../feed.xml">feed</a></p> - </footer> - -</div> -</body> -</html> 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 "<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](../projects/index.html). And the capsule is still there — see the [colophon](../about/index.html) for how it all fits together. diff --git a/weblog/index.html b/weblog/index.html index 8510f60..f67da6b 100644 --- a/weblog/index.html +++ b/weblog/index.html @@ -14,8 +14,8 @@ <header class="site"> <h1 class="brand"><a href="../index.html">~tjp<span class="cur"> $_</span></a></h1> <nav class="main"> - <a href="../weblog/index.html" aria-current="page">weblog</a> - <!-- <a href="../notes/index.html">notes</a> --> + <a href="index.html" aria-current="page">weblog</a> + <a href="../projects/index.html">projects</a> <a href="../about/index.html">about</a> <a href="../feed.xml">feed</a> @@ -27,16 +27,15 @@ <p>Longer-form writing. Most of these are migrating over from my Gemini capsule, so dates reflect the original posting. <a href="../feed.xml">Subscribe via RSS</a>.</p> </section> + </main> <footer> - <!-- <div class="ring"> - <span>webring:</span> - <a href="#">← prev</a><a href="#">rand</a><a href="#">next →</a> - </div> --> - <p>hand-written in slc · ©2026 tjp · <a href="../feed.xml">feed</a></p> + + <p>©2026 tjp · content <a href="https://creativecommons.org/licenses/by/4.0/">CC BY 4.0</a> unless noted · <a href="../feed.xml">feed</a></p> </footer> </div> </body> </html> + diff --git a/weblog/index.html.tmpl b/weblog/index.html.tmpl new file mode 100644 index 0000000..9d97024 --- /dev/null +++ b/weblog/index.html.tmpl @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<html lang="en"> +<head> +<meta charset="utf-8"> +<meta name="viewport" content="width=device-width, initial-scale=1"> +<title>Weblog — tjp.lol</title> +<meta name="description" content="Weblog posts by tjp."> +<link rel="stylesheet" href="../style.css"> +<link rel="alternate" type="application/atom+xml" title="tjp.lol" href="../feed.xml"> +</head> +<body> +<div class="wrap"> + +{{template "header" .}} + <main> + <section class="intro"> + <p>Longer-form writing. Most of these are migrating over from my Gemini capsule, so dates reflect the original posting. <a href="../feed.xml">Subscribe via RSS</a>.</p> + </section> + + {{$posts := sortPages (index .Pages "weblog") "post_date"}}{{with $posts}}<section> + <ul class="posts"> + {{range .}}<li><time datetime="{{date (index .Meta "post_date") "2006-01-02"}}">{{date (index .Meta "post_date") "2006-01-02"}}</time><a href="{{rel "weblog/index.html" .OutputPath}}">{{.Title}}</a></li>{{end}} + </ul> + </section>{{end}} + </main> + +{{template "footer" .}} |
