site/layouts/posts/single.gmi

42 lines
1.2 KiB
Plaintext
Raw Normal View History

{{ define "content" -}}
# {{ $.Title }}
2021-02-23 10:18:00 +00:00
2021-09-22 09:00:29 +00:00
Posted {{ .Date.Format "2006-01-02" }}
2024-04-10 13:14:23 +00:00
{{- $lastmod := .Lastmod }}
{{- if lt .Date $lastmod }}
Last updated {{ .Lastmod.Format "2006-01-02" }}
{{- end }}
{{- $taxonomy := "tags" }}
{{- with .Param $taxonomy }}
{{- if gt (len .) 1 }}
Tags:
2024-04-10 13:14:23 +00:00
{{- else if gt (len .) 0 }}
Tag:
{{- end -}}
{{ range $index, $tag := . -}}{{- with $.Site.GetPage (printf "/%s/%s" $taxonomy $tag) -}}
{{- if $index -}}, {{ end -}}{{ if (not $index) }}{{printf " "}}{{end}}{{ $tag | urlize }}{{- end -}}{{- end }}
{{- end }}
--
2021-02-23 10:18:00 +00:00
{{- /*
* https://discourse.gohugo.io/t/using-renderstring-to-expand-shortcodes/40994/7
* support for using shortcodes in gemtext whilst having content as raw text.
*/ -}}
{{- $content := printf "~~~\n%s~~~" (trim (readFile (replace $.File.Path ".md" ".gmi")) "\n" | safeHTML) | .Page.RenderString | htmlUnescape }}
{{- $lines := split $content "\n" }}
{{- range $i, $_ := $lines }}
{{- if and $i (ne $i (sub (len $lines) 1)) }}
{{ . }}
{{- end -}}
{{- end -}}
2021-02-16 01:46:37 +00:00
2021-09-22 09:00:29 +00:00
--
Questions/comments:
=> mailto:~hedy/posts@lists.sr.ht Public gemlog mailing list (plain-text only)
=> mailto:{{ .Site.Author.email }} Or email me directly
2024-04-10 13:14:23 +00:00
=> / Home
{{- end }}