summaryrefslogtreecommitdiff
path: root/layouts/partials/pageinfo.gmi
diff options
context:
space:
mode:
authorNicholas Johnson <mail@nicholasjohnson.ch>2025-02-06 00:00:00 +0000
committerNicholas Johnson <mail@nicholasjohnson.ch>2025-02-06 00:00:00 +0000
commite17004fc6714b7d214aa61f43fa75f1fc9bc0ec00804e0525452cb287a81958a (patch)
tree3228b770bc360cfaed9d1fe4867c0b09e7eb3cabd6fe992ab193dd1f43bcb416 /layouts/partials/pageinfo.gmi
parent5844d48eefde01b72463dc83a091d18e06c5e37148e611b342e2a42fb2476c70 (diff)
downloadhugo-theme-journal-e17004fc6714b7d214aa61f43fa75f1fc9bc0ec00804e0525452cb287a81958a.tar.gz
hugo-theme-journal-e17004fc6714b7d214aa61f43fa75f1fc9bc0ec00804e0525452cb287a81958a.zip
Add non-breaking spaces within entry tag names
The spaces in tag names must be non-breaking because tag names split across multiple lines are visually indistinguishable from distinct tags.
Diffstat (limited to 'layouts/partials/pageinfo.gmi')
-rw-r--r--layouts/partials/pageinfo.gmi9
1 files changed, 8 insertions, 1 deletions
diff --git a/layouts/partials/pageinfo.gmi b/layouts/partials/pageinfo.gmi
index adde0c0..9993d93 100644
--- a/layouts/partials/pageinfo.gmi
+++ b/layouts/partials/pageinfo.gmi
@@ -8,4 +8,11 @@
{{ $nonBreakingReadingTime = replace $nonBreakingReadingTime " " " " -}}
{{ $nonBreakingReadingTime = replace $nonBreakingReadingTime "-" "‑" -}}
-{{ emojify ":calendar:" }} {{ $nonBreakingPublishDate }} | {{ emojify ":stopwatch:" }} {{ $nonBreakingReadingTime }}{{ if (.Param (lower (i18n "tags"))) }} | {{ emojify ":label:" }} {{ end }}{{ range $key, $val := (.Param (lower (i18n "tags"))) }}{{ if $key }}, {{ end }}{{ $val }}{{ end }} \ No newline at end of file
+{{ $nonBreakingTags := slice -}}
+{{ range .Param (lower (i18n "tags")) -}}
+ {{ $nonBreakingTag := replace . " " " " -}}
+ {{ $nonBreakingTag = replace $nonBreakingTag "-" "‑" -}}
+ {{ $nonBreakingTags = $nonBreakingTags | append $nonBreakingTag -}}
+{{ end -}}
+
+{{ emojify ":calendar:" }} {{ $nonBreakingPublishDate }} | {{ emojify ":stopwatch:" }} {{ $nonBreakingReadingTime }}{{ if $nonBreakingTags }} | {{ emojify ":label:" }} {{ end }}{{ range $key, $val := $nonBreakingTags }}{{ if $key }}, {{ end }}{{ $val }}{{ end }} \ No newline at end of file