From d4ece493ba32ff5e48abb63a167c6713dbf64266 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Tue, 28 Jan 2020 10:50:31 +0200 Subject: [PATCH] layouts/partials/meta-terms.html: Trailing slash Hard code a trailing slash in URLs for categories and tags to avoid an HTTP 301 redirect at the very least, and an HTTP 404 at the very worst (depending on web server configuration). This is a workaround for a problem caused by our manual construction of URLs using the categories and tags strings in post front matter. Hugo's own taxonomy tooling always uses a trailing slash. See: https://github.com/alanorth/hugo-theme-bootstrap4-blog/issues/128 --- layouts/partials/meta-terms.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/partials/meta-terms.html b/layouts/partials/meta-terms.html index 6623e5a..e130fc1 100644 --- a/layouts/partials/meta-terms.html +++ b/layouts/partials/meta-terms.html @@ -1,8 +1,8 @@ {{ if .Params.categories }} - {{ range $index, $category := .Params.categories }}{{ if gt $index 0 }}{{ i18n "comma" }} {{ end }}{{ . }}{{ end }} + {{ range $index, $category := .Params.categories }}{{ if gt $index 0 }}{{ i18n "comma" }} {{ end }}{{ . }}{{ end }} {{ end }} {{ if .Params.tags }} - {{ range $index, $tag := .Params.tags }}{{ if gt $index 0 }}{{ i18n "comma" }} {{ end }}{{ end }} + {{ range $index, $tag := .Params.tags }}{{ if gt $index 0 }}{{ i18n "comma" }} {{ end }}{{ end }} {{ end }} {{- /* vim: set ts=2 sw=2 et: */}}