mirror of
https://github.com/alanorth/hugo-theme-bootstrap4-blog.git
synced 2024-11-14 16:27:04 +01:00
Alan Orth
d4ece493ba
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
9 lines
597 B
HTML
9 lines
597 B
HTML
{{ if .Params.categories }}
|
|
<span class="fas fa-folder" aria-hidden="true"></span> {{ range $index, $category := .Params.categories }}{{ if gt $index 0 }}{{ i18n "comma" }} {{ end }}<a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}/" rel="category tag">{{ . }}</a>{{ end }}
|
|
{{ end }}
|
|
{{ if .Params.tags }}
|
|
<span class="fas fa-tag" aria-hidden="true"></span> {{ range $index, $tag := .Params.tags }}{{ if gt $index 0 }}{{ i18n "comma" }} {{ end }}<a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}/" rel="tag">{{ . }}</a>{{ end }}
|
|
{{ end }}
|
|
|
|
{{- /* vim: set ts=2 sw=2 et: */}}
|