From f52991466a86a32ebaa3ba8dd1f3cc77ea609b0a6aed370470242bfffa1d8cdf Mon Sep 17 00:00:00 2001 From: Nicholas Johnson Date: Fri, 24 Feb 2023 00:00:00 +0000 Subject: Add tag list to metadata partial --- layouts/_default/single.gmi | 2 +- layouts/_default/single.html | 2 +- layouts/index.html | 2 ++ layouts/partials/metadata.gmi | 4 ++-- layouts/partials/metadata.html | 2 -- layouts/partials/pageinfo | 2 -- layouts/partials/pageinfo.gmi | 2 ++ layouts/partials/pageinfo.html | 2 ++ 8 files changed, 10 insertions(+), 8 deletions(-) delete mode 100644 layouts/partials/pageinfo create mode 100644 layouts/partials/pageinfo.gmi create mode 100644 layouts/partials/pageinfo.html (limited to 'layouts') diff --git a/layouts/_default/single.gmi b/layouts/_default/single.gmi index e7e4d0c..54c4070 100644 --- a/layouts/_default/single.gmi +++ b/layouts/_default/single.gmi @@ -3,7 +3,7 @@ => / {{ emojify ":link:" }} Return to homepage -{{ if (.Page.Params.pageinfo | default true) }}{{ partial "pageinfo" . }} +{{ if (.Page.Params.pageinfo | default true) }}{{ partial "pageinfo.gmi" . }} {{ end -}} # {{ .Name | safeHTML }} diff --git a/layouts/_default/single.html b/layouts/_default/single.html index d5e9547..6870ecc 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -3,7 +3,7 @@

{{ emojify ":link:" }} Return to homepage

{{- if (.Page.Params.pageinfo | default true) }} -

{{ partial "pageinfo" . }}

{{ end }} +

{{ partial "pageinfo.html" . }}

{{ end }}

{{ .Name }}

{{ .Content -}} diff --git a/layouts/index.html b/layouts/index.html index 78fd0d5..9c4bb45 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -11,6 +11,8 @@

Journal Entries

+ {{ range (where .Site.RegularPages.ByTitle "Section" "entry").ByPublishDate.Reverse -}} {{ partial "metadata.html" . -}} + {{ end -}}
{{- end }} diff --git a/layouts/partials/metadata.gmi b/layouts/partials/metadata.gmi index f175f9e..c110826 100644 --- a/layouts/partials/metadata.gmi +++ b/layouts/partials/metadata.gmi @@ -1,10 +1,10 @@ {{ $entriesMinusOne := sub (len (where .Site.RegularPages.ByTitle "Section" "entry").ByPublishDate.Reverse) 1 }} {{- range first $entriesMinusOne (where .Site.RegularPages.ByTitle "Section" "entry").ByPublishDate.Reverse }} -{{- partial "pageinfo" . }} +{{- partial "pageinfo.gmi" . }} => .{{ .RelPermalink }} {{ emojify ":link:" }} {{ .Title | safeHTML }} {{ end }} {{- range last 1 (where .Site.RegularPages.ByTitle "Section" "entry").ByPublishDate.Reverse }} -{{- partial "pageinfo" . }} +{{- partial "pageinfo.gmi" . }} => .{{ .RelPermalink }} {{ emojify ":link:" }} {{ .Title | safeHTML }}{{ end }} \ No newline at end of file diff --git a/layouts/partials/metadata.html b/layouts/partials/metadata.html index f96af41..a05ff17 100644 --- a/layouts/partials/metadata.html +++ b/layouts/partials/metadata.html @@ -1,8 +1,6 @@ -{{ range (where .Site.RegularPages.ByTitle "Section" "entry").ByPublishDate.Reverse -}}

{{ partial "pageinfo.html" . }}
{{ emojify ":link:" }} {{ .Title }}

-{{ end }} diff --git a/layouts/partials/pageinfo b/layouts/partials/pageinfo deleted file mode 100644 index 269b04e..0000000 --- a/layouts/partials/pageinfo +++ /dev/null @@ -1,2 +0,0 @@ -{{ $dateFormat := .Site.Params.dateFormat | default "2 Jan 2006" -}} -{{ emojify ":calendar:" }} {{ .Page.PublishDate.Format $dateFormat | safeHTML }} | {{ emojify ":stopwatch:" }} {{ .Page.ReadingTime | safeHTML }} minute read \ No newline at end of file diff --git a/layouts/partials/pageinfo.gmi b/layouts/partials/pageinfo.gmi new file mode 100644 index 0000000..779a370 --- /dev/null +++ b/layouts/partials/pageinfo.gmi @@ -0,0 +1,2 @@ +{{ $dateFormat := .Site.Params.dateFormat | default "2 Jan 2006" -}} +{{ emojify ":calendar:" }} {{ .Page.PublishDate.Format $dateFormat | safeHTML }} | {{ emojify ":stopwatch:" }} {{ .Page.ReadingTime | safeHTML }} minute read{{ if .Page.Params.Tags }} | {{ emojify ":label:" }} {{ end }}{{ range $key, $val := .Page.Params.Tags }}{{ if $key }}, {{ end }}{{ $val }}{{ end }} \ No newline at end of file diff --git a/layouts/partials/pageinfo.html b/layouts/partials/pageinfo.html new file mode 100644 index 0000000..c6643dc --- /dev/null +++ b/layouts/partials/pageinfo.html @@ -0,0 +1,2 @@ +{{ $dateFormat := .Site.Params.dateFormat | default "2 Jan 2006" -}} +{{ emojify ":calendar:" }} {{ .Page.PublishDate.Format $dateFormat | safeHTML }} | {{ emojify ":stopwatch:" }} {{ .Page.ReadingTime | safeHTML }} minute read{{ if .Page.Params.Tags }} | {{ emojify ":label:" }} {{ end }}{{ range $key, $val := .Page.Params.Tags }}{{ if $key }}, {{ end }}{{ $val }}{{ end }} -- cgit v1.2.3