summaryrefslogtreecommitdiff
path: root/layouts/page.gmi
diff options
context:
space:
mode:
authorandre4ik3 <andre4ik3@fastmail.com>2025-08-18 17:42:27 +0000
committerandre4ik3 <andre4ik3@fastmail.com>2025-08-18 17:42:27 +0000
commitd9ff6edbfcdc408e23684c00df806eac72fd02b2 (patch)
tree45a8fe89aa4de37a2dab4b293330874e37907beb /layouts/page.gmi
Initial commit
Diffstat (limited to 'layouts/page.gmi')
-rw-r--r--layouts/page.gmi21
1 files changed, 21 insertions, 0 deletions
diff --git a/layouts/page.gmi b/layouts/page.gmi
new file mode 100644
index 0000000..7a9cfc8
--- /dev/null
+++ b/layouts/page.gmi
@@ -0,0 +1,21 @@
+{{ define "main" }}
+# {{ .Title }}
+
+{{
+ .Content
+ | transform.HTMLUnescape
+ | strings.ReplaceRE `<strong>(.*)</strong>` `*$1*`
+ | strings.ReplaceRE `<em>(.*)</em>` `*$1*`
+ | strings.ReplaceRE `<code>(.*)</code>` "`$1`"
+
+ | strings.ReplaceRE `<p>(.*)</p>` "$1\n"
+ | strings.ReplaceRE `<p>(.*)\n` "$1 "
+ | strings.ReplaceRE `\n(.*)</p>` " $1\n"
+ | strings.ReplaceRE `(\w.+?)\n(\w.+?)` "$1 $2"
+
+ | strings.ReplaceRE `</?[uo]l>` ``
+ | strings.ReplaceRE `<li>(.*)\n` `* $1`
+ | strings.ReplaceRE `</li>` ``
+}}
+
+{{ end }}