Show tags in gemini post listing

This commit is contained in:
hedy 2024-04-11 18:30:17 +08:00
parent 858544b7d6
commit e211f5d41f
Signed by: hedy
GPG Key ID: B51B5A8D1B176372
2 changed files with 5 additions and 4 deletions

View File

@ -11,5 +11,6 @@
{{ 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 }}
{{ end -}}

View File

@ -1,4 +1,4 @@
{{- $taxonomy := "tags" }}
{{- with .Param $taxonomy }}
Tagged{{ range $index, $tag := . -}}{{- with $.Site.GetPage (printf "/%s/%s" $taxonomy $tag) -}}
{{- if $index -}}, {{ end -}}{{ if (not $index) }}{{ printf " " }}{{ end }}{{ $tag | urlize }}{{ end }}{{ end }}{{- end }}
{{ $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 }}