From e17004fc6714b7d214aa61f43fa75f1fc9bc0ec00804e0525452cb287a81958a Mon Sep 17 00:00:00 2001 From: Nicholas Johnson Date: Thu, 6 Feb 2025 00:00:00 +0000 Subject: 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. --- layouts/partials/pageinfo.gmi | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'layouts/partials/pageinfo.gmi') 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 -- cgit v1.2.3