refactor: use relLangURL to build relative links
For better i18n support Fixes archive page path Remove tag cloud term exclusion closes https://github.com/CaiJimmy/hugo-theme-stack/issues/8
This commit is contained in:
@@ -7,10 +7,10 @@
|
||||
{{ if and $image.exists $image.resource }}
|
||||
{{- $imageRaw := $image.resource | resources.Fingerprint "md5" -}}
|
||||
{{- $20x := $imageRaw.Fill "20x20 smart" -}}
|
||||
<a href="/categories/{{ . | urlize }}" class="color-tag"
|
||||
<a href="{{ printf `categories/%s` (. | urlize) | relLangURL }}" class="color-tag"
|
||||
data-image="{{ $20x.RelPermalink }}" data-key="{{ $context.Slug }}" data-hash="{{ $imageRaw.Data.Integrity }}">{{ . | humanize }}</a>
|
||||
{{ else }}
|
||||
<a href="/categories/{{ . | urlize }}">{{ . | humanize }}</a>
|
||||
<a href="{{ printf `categories/%s` (. | urlize) | relLangURL }}">{{ . | humanize }}</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</header>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
{{ with $tags := .Params.Tags }}
|
||||
<section class="article-tags">
|
||||
{{ range $tags }}
|
||||
<a href="/tags/{{ . | urlize }}">{{ . | humanize }}</a>
|
||||
<a href="{{ printf `tags/%s` (. | urlize) | relLangURL }}">{{ . | humanize }}</a>
|
||||
{{ end }}
|
||||
</section>
|
||||
{{ end }}
|
||||
|
||||
Reference in New Issue
Block a user