Skip to content

Commit d4ece49

Browse files
committed
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: #128
1 parent 3ab60bd commit d4ece49

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

layouts/partials/meta-terms.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{{ if .Params.categories }}
2-
<span class="fas fa-folder" aria-hidden="true"></span>&nbsp;{{ range $index, $category := .Params.categories }}{{ if gt $index 0 }}{{ i18n "comma" }} {{ end }}<a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}" rel="category tag">{{ . }}</a>{{ end }}
2+
<span class="fas fa-folder" aria-hidden="true"></span>&nbsp;{{ range $index, $category := .Params.categories }}{{ if gt $index 0 }}{{ i18n "comma" }} {{ end }}<a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}/" rel="category tag">{{ . }}</a>{{ end }}
33
{{ end }}
44
{{ if .Params.tags }}
5-
<span class="fas fa-tag" aria-hidden="true"></span>&nbsp;{{ range $index, $tag := .Params.tags }}{{ if gt $index 0 }}{{ i18n "comma" }} {{ end }}<a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}" rel="tag">{{ . }}</a>{{ end }}
5+
<span class="fas fa-tag" aria-hidden="true"></span>&nbsp;{{ range $index, $tag := .Params.tags }}{{ if gt $index 0 }}{{ i18n "comma" }} {{ end }}<a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}/" rel="tag">{{ . }}</a>{{ end }}
66
{{ end }}
77

88
{{- /* vim: set ts=2 sw=2 et: */}}

0 commit comments

Comments
 (0)