aboutsummaryrefslogtreecommitdiff
path: root/layouts
diff options
context:
space:
mode:
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/list.gmi16
-rw-r--r--layouts/_default/single.gmi11
2 files changed, 27 insertions, 0 deletions
diff --git a/layouts/_default/list.gmi b/layouts/_default/list.gmi
new file mode 100644
index 0000000..8560760
--- /dev/null
+++ b/layouts/_default/list.gmi
@@ -0,0 +1,16 @@
+# {{ .Title }}
+
+{{ $content := .Content -}}
+
+{{ $content := $content | replaceRE `{{<\s*(?:rel)?ref\s+"([^"]+)"\s*>}}` "$1" -}}
+{{ $content := $content | replaceRE `{{<\s*figure\s*(?:.*)?src="([^"]+)"(?:.*)?caption="([^"]+)"(?:.*)?>}}` "![$2]($1)" -}}
+{{ $content := $content | replaceRE `{{<\s*image\s*.*?src="([^"]+)".*?>}}` "![]($1)" -}}
+{{ $content := $content | replaceRE "(?s:< !--more-- >)" "" -}}
+{{ $content := $content | replace "<!-- more -->" "" -}}
+{{ $content := $content | replaceRE `\[(.+?)\]\((.+?)\)` "\n=> $2 $1\n" -}}
+
+{{ $content }}
+
+{{ range .Pages.ByPublishDate.Reverse }}
+=> {{ .RelPermalink | replaceRE `index.gmi` `` }}{{if .Date }} {{ .Date.Format "2006-01-02" }}{{ end }} {{ .Title }}
+{{ end }} \ No newline at end of file
diff --git a/layouts/_default/single.gmi b/layouts/_default/single.gmi
new file mode 100644
index 0000000..10d9876
--- /dev/null
+++ b/layouts/_default/single.gmi
@@ -0,0 +1,11 @@
+# {{ .Title }}
+
+{{ $content := .RawContent -}}
+
+{{ $content := $content | replaceRE "(?s:< !--more-- >)" "" -}}
+{{ $content := $content | replaceRE `\[(.+?)\]\((.+?)\)` "\n=> $2 $1\n" -}}
+
+{{ $content }}
+
+---
+NeonXP at {{ .Date.Format "2006-01-02" }}