commit 81214f6c9ee950a11c1079e3f5731b7737fcb4fe parent 340713952e215dd7d8bb23a4bf2ec8319c3469ae Author: David Eisinger <[email protected]> Date: Wed, 19 Feb 2025 01:09:28 -0500 Gemini homepage Diffstat:
| M | themes/v2/layouts/index.gmi | | | 11 | ++++++++--- |
| M | themes/v2/layouts/partials/gemtext.gmi | | | 1 | + |
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/themes/v2/layouts/index.gmi b/themes/v2/layouts/index.gmi @@ -1,8 +1,13 @@ {{- define "main" -}} # David Eisinger -{{ partial "gemtext.gmi" (dict "content" .RawContent "page" $.Page) }} -{{ range (where .Site.RegularPages "Type" "in" "journal") -}} +{{ partial "gemtext.gmi" (dict "content" .RawContent "page" $.Page) -}} + +## Recent Posts + +{{ range first 10 (where .Site.RegularPages "Type" "in" "journal") -}} => {{ .RelPermalink | replaceRE `index.gmi` "" }} {{ .Title }} -{{ end -}} +{{ end }} + +=> /journal/ All Posts {{- end -}} diff --git a/themes/v2/layouts/partials/gemtext.gmi b/themes/v2/layouts/partials/gemtext.gmi @@ -55,5 +55,6 @@ {{- $content = $content | replaceRE `=> /(elsewhere[^ ])` (printf "=> %s$1" site.BaseURL) -}} {{- $content = $content | replaceRE `(?m)^(\* [^\n]+)\n\n ` "$1 " -}} {{- $content = $content | replaceRE `(?m)\n{3,}` "\n\n" }} +{{- $content = $content | replaceRE `\n+$` "" }} {{- $content | safeHTML -}}