From dabea0efa5b58f6da478549d3889a56d5d1b5a09 Mon Sep 17 00:00:00 2001 From: Alexander Neonxp Kiryukhin Date: Fri, 20 Dec 2024 00:13:19 +0300 Subject: Auto-commit 2024-12-20 --- layouts/_default/list.gmi | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 layouts/_default/list.gmi (limited to 'layouts/_default/list.gmi') 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 "" "" -}} +{{ $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 -- cgit v1.2.3