From 9bb7cf108d01ebefacd5cc17733c5e6a0e824727 Mon Sep 17 00:00:00 2001 From: John Bowdre Date: Tue, 27 Feb 2024 22:32:12 -0600 Subject: [PATCH] minor gemini layout tweaks --- layouts/_default/index.gmi | 20 +++++--------------- layouts/_default/single.gmi | 13 +++++++++---- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/layouts/_default/index.gmi b/layouts/_default/index.gmi index 31120ba..67226c6 100644 --- a/layouts/_default/index.gmi +++ b/layouts/_default/index.gmi @@ -1,22 +1,12 @@ -``` - ___ _ _ _ _ ___ -| _| | | (_) | | | |_ | -| | _ __ _ _ _ __ | |_ _ _ __ ___ ___| |_ ___ _ __ _ __ ___ _ __ / __)| | -| || '__| | | | '_ \| __| | '_ ` _ \ / _ \ __/ _ \ '__| '__/ _ \| '__| \__ \| | -| || | | |_| | | | | |_| | | | | | | __/ || __/ | | | | (_) | | ( /| | -| ||_| \__,_|_| |_|\__|_|_| |_| |_|\___|\__\___|_| |_| \___/|_| |_|_| | -|___| |___| -``` - -Adventures in self-hosting and other technological frustrations. - +# [runtimeterror $] +=> /about Adventures in self-hosting and other technological frustrations. {{ $pages := .Pages -}} {{ $pages = where site.RegularPages "Type" "in" site.Params.mainSections -}} +### Posts {{ range $pages }} -=> {{ .RelPermalink }} [{{ .Date.Format "2006-01-02" }}] {{ .Title }} +=> {{ .RelPermalink }} {{ .Date.Format "2006-01-02" }} {{ .Title }} {{- end }} --- -=> /about About -=> https://runtimeterror.dev View this site on the WWW \ No newline at end of file +=> https://runtimeterror.dev This site on the big web \ No newline at end of file diff --git a/layouts/_default/single.gmi b/layouts/_default/single.gmi index 49d76de..4c2436d 100644 --- a/layouts/_default/single.gmi +++ b/layouts/_default/single.gmi @@ -1,6 +1,12 @@ => / 💻 [runtimeterror $] # {{ .Title }}{{ $scratch := newScratch }} +{{- if .Params.Date }} + {{- $postDate := .Date.Format "2006-01-02" }} + {{- $updateDate := .Lastmod.Format "2006-01-02" }} + {{ $postDate }}{{ if ne $postDate $updateDate }} ~ {{ $updateDate }}{{ end }} +{{- end }} +{{/* The bulk of this regex magic is derived from https://brainbaking.com/post/2021/04/using-hugo-to-launch-a-gemini-capsule/ */}} {{ $content := .RawContent -}} {{ $content := $content | replaceRE `#### ` "### " -}} {{ $content := $content | replaceRE `\n- (.+?)` "\n* $1" -}} @@ -24,10 +30,9 @@ {{ $content | safeHTML }} --- -Written by John Bowdre {{ if .Params.Date }} on {{ .Lastmod.Format "2006-01-02" }}.{{ end}} => mailto:blog@runtimeterror.dev 📧 Reply via email -## Links +## Bibliography {{ $scratch.Set "ref" (add (len $links) 1) }}{{ range $refs }}{{ $ref := $scratch.Get "ref" }}{{ $url := (printf "%s #%d" . $ref) }} => {{ $url | replaceRE `\[(.+?)\]\((.+?)\) #(\d+)` "$2 [$3] $1 ($2)" -}} {{ $scratch.Set "ref" (add $ref 1) }}{{ end}} @@ -38,5 +43,5 @@ Written by John Bowdre {{ if .Params.Date }} on {{ .Lastmod.Format "2006-01-02" => {{ replace .RelPermalink "/gemini" "" 1}} {{ .Title }}{{ end }}{{ end }} --- -=> / Back to the Index -=> https://runtimeterror.dev{{ replace (replace .RelPermalink "/gemini" "" 1) "index.gmi" "" }} View this article on the WWW \ No newline at end of file +=> / Home +=> https://runtimeterror.dev{{ replace (replace .RelPermalink "/gemini" "" 1) "index.gmi" "" }} This article on the big web \ No newline at end of file