commit 034d3e30d13155cf68560f6cc45dd25d82478694
parent c6e95046e3e8929dad7b7bb6738688ffa1d1ee77
Author: David Eisinger <[email protected]>
Date: Sat, 15 Feb 2025 01:04:11 -0500
Start gemini output
Diffstat:
4 files changed, 30 insertions(+), 1 deletion(-)
diff --git a/config.toml b/config.toml
@@ -27,3 +27,18 @@ autoHeadingIDType = 'blackfriday'
[security.funcs]
getenv = ['DITHER_SERVER']
+
+[mediaTypes."text/gemini"]
+suffixes = ["gmi"]
+
+[outputFormats.GEMINI]
+name = "GEMINI"
+isPlainText = true
+isHTML = false
+mediaType = "text/gemini"
+protocol = "gemini://"
+permalinkable = true
+
+[outputs]
+home = ["HTML", "RSS", "GEMINI"]
+page = ["HTML", "GEMINI"]
diff --git a/content/_index.md b/content/_index.md
@@ -1,4 +1,3 @@
I'm a technologist in Durham, North Carolina, USA. I write about adventures with my family, stuff I make, and interesting things I find on the web. [More about me.][1]
[1]: /about/
-[2]: https://www.viget.com/
diff --git a/themes/v2/layouts/_default/single.gmi b/themes/v2/layouts/_default/single.gmi
@@ -0,0 +1,9 @@
+# {{ .Title }}
+{{ $content := .RawContent -}}
+{{ $content = $content | replaceRE `<!--more-->\n+` "" -}}
+{{ $content = $content | replaceRE `\[([^\]]+)\]\[(\d+)\]` "$1[$2]" -}}
+{{ $content = $content | replaceRE `(?m)^\[(\d+)\]: (.*)$` "=> $2 [$1] $2" -}}
+{{ $content = $content | replaceRE `(?m)\n\n >` "\n\n" -}}
+{{ $content = $content | replaceRE `(?m)\n\n ([^>])` " $1" -}}
+{{ $content = $content | replaceRE `<audio controls src="([^"]+)"><\/audio>` "=> $1" }}
+{{ $content | safeHTML }}
diff --git a/themes/v2/layouts/index.gmi b/themes/v2/layouts/index.gmi
@@ -0,0 +1,6 @@
+# David Eisinger
+
+{{ .RawContent }}
+{{ range (where .Site.RegularPages "Type" "in" "journal") -}}
+=> {{ .RelPermalink | replaceRE `index.gmi` "" }} {{ .Title }}
+{{ end -}}