summaryrefslogtreecommitdiff
path: root/layouts/partials
diff options
context:
space:
mode:
authorNicholas Johnson <nick@nicholasjohnson.ch>2023-02-24 00:00:00 +0000
committerNicholas Johnson <nick@nicholasjohnson.ch>2023-02-24 00:00:00 +0000
commitf52991466a86a32ebaa3ba8dd1f3cc77ea609b0a6aed370470242bfffa1d8cdf (patch)
treef9097667d46a9a1c69655910639725d397b9379741b074dd55f729498041e060 /layouts/partials
parent1f150c43cafe1074b3fe24bf1472a49b8bcf8ff583bdc6f7098e266f6e1e84c9 (diff)
downloadhugo-theme-journal-f52991466a86a32ebaa3ba8dd1f3cc77ea609b0a6aed370470242bfffa1d8cdf.tar.gz
hugo-theme-journal-f52991466a86a32ebaa3ba8dd1f3cc77ea609b0a6aed370470242bfffa1d8cdf.zip
Add tag list to metadata partial
Diffstat (limited to 'layouts/partials')
-rw-r--r--layouts/partials/metadata.gmi4
-rw-r--r--layouts/partials/metadata.html2
-rw-r--r--layouts/partials/pageinfo.gmi (renamed from layouts/partials/pageinfo)2
-rw-r--r--layouts/partials/pageinfo.html2
4 files changed, 5 insertions, 5 deletions
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 -}}
<article>
<header>
<p>{{ partial "pageinfo.html" . }}<br>
{{ emojify ":link:" }}&nbsp;<a class="link" href="{{ .RelPermalink }}" rel="noreferrer">{{ .Title }}</a></p>
</header>
</article>
-{{ end }}
diff --git a/layouts/partials/pageinfo b/layouts/partials/pageinfo.gmi
index 269b04e..779a370 100644
--- a/layouts/partials/pageinfo
+++ b/layouts/partials/pageinfo.gmi
@@ -1,2 +1,2 @@
{{ $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
+{{ 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 }}<a class="link" href='{{ "/tags/" }}{{ . | urlize }}' rel="noreferrer">{{ $val }}</a>{{ end }}