Better place to show tags in gemini

This commit is contained in:
hedy 2024-04-11 18:53:53 +08:00
parent e211f5d41f
commit 60141b41d2
Signed by: hedy
GPG Key ID: B51B5A8D1B176372
2 changed files with 2 additions and 3 deletions

View File

@ -11,6 +11,5 @@
{{ range (where .Site.RegularPages "Section" "posts") }}
{{- if .OutputFormats.Get "gemtext" }}
=> {{replace (replace .RelPermalink "/gemini" "" 1) "/index.gmi" ".gmi" 1}} {{ .Date.Format "2006-01-02" }} · {{.Title | safeHTML}}{{ end }}
{{ partial "tags.gmi" (dict "Page" . "Prefix" "> ") -}}
{{ .Description }}
{{ .Description }}{{ partial "tags.gmi" (dict "Page" . "Prefix" " (tagged " "Postfix" ")") -}}
{{ end -}}

View File

@ -1,4 +1,4 @@
{{ $taxonomy := "tags" -}}
{{ with .Page.Param $taxonomy -}}{{ with $.Prefix }}{{ . | safeHTML }}{{ end }}
{{- range $index, $tag := . -}}{{- with $.Page.Site.GetPage (printf "/%s/%s" $taxonomy $tag) -}}
{{- if $index -}}, {{ end -}}#{{ $tag | urlize }}{{ end }}{{ end }}{{- end }}
{{- if $index -}}, {{ end -}}#{{ $tag | urlize }}{{ end }}{{ end }}{{ with $.Postfix }}{{ . | safeHTML }}{{ end }}{{ end }}