commit 364f39a76116e301868d85ca3e05d0f2adab211d
parent 42f4bc63adce93ab91350d5553c89090afbf0fb5
Author: David Eisinger <[email protected]>
Date: Sun, 16 Feb 2025 02:38:31 -0500
Refactor
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/themes/v2/layouts/partials/gemtext.gmi b/themes/v2/layouts/partials/gemtext.gmi
@@ -3,10 +3,12 @@
{{ $content = $content | replaceRE `<!--more-->\n+` "" -}}
{{ $content = $content | replaceRE `\[([^\]]+)\]\[(\d+)\]` "$1[$2]" -}}
{{ $content = $content | replaceRE `(?m)^\[(\d+)\]: (.*)$` "=> $2 [$1] $2" -}}
-{{ $content = $content | replaceRE `=> (/.+\.pdf)` (printf "=> %s$1" site.BaseURL) -}}
-{{ $content = $content | replaceRE `(?m) >` ">" -}}
+{{ $content = $content | replaceRE `\[([^\]]+)\]\([^\)]+\)` "$1" -}}
+{{ $content = $content | replaceRE `(?m)^ >` ">" -}}
{{ $content = $content | replaceRE `(?m)^ \*` "* ⇢" -}}
+{{ $content = $content | replaceRE `(?m)^- ` "* " -}}
{{ $content = $content | replaceRE `(?m)^[\*-]{3}$` "✱ ✱ ✱" -}}
+{{ $content = $content | replaceRE `=> (/.+\.pdf)` (printf "=> %s$1" site.BaseURL) -}}
{{ $audioRE := `<audio controls src="(.*/([^"]+))"></audio>` -}}
{{ range findRE $audioRE $content -}}
{{ $url := . | replaceRE $audioRE "$1" | replaceRE ` ` "%20" -}}