Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CaiJimmy/hugo-theme-stack.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJimmy Cai <jimmehcai@gmail.com>2020-09-18 21:05:19 +0300
committerJimmy Cai <jimmehcai@gmail.com>2020-09-18 21:05:19 +0300
commit117dd4b81e8a0d6d0b95f7bcf1228fa74d793bb8 (patch)
tree606ccad4dfddc3ab6dff38741fbd4f56c9d8a566 /layouts/partials/article/components/details.html
parentb2a1afd744f84a459934043d80548dd1b0a34365 (diff)
fix(article/details): fix custom taxonomy link
Diffstat (limited to 'layouts/partials/article/components/details.html')
-rw-r--r--layouts/partials/article/components/details.html17
1 files changed, 8 insertions, 9 deletions
diff --git a/layouts/partials/article/components/details.html b/layouts/partials/article/components/details.html
index 1a3faa9..016e9d6 100644
--- a/layouts/partials/article/components/details.html
+++ b/layouts/partials/article/components/details.html
@@ -5,15 +5,14 @@
{{ if $categories }}
<header class="article-category">
{{ range $category := $categories }}
- {{ with $.Site.GetPage (printf "/categories/%s" $category) }}
- {{ if and $image.exists $image.resource }}
- {{- $imageRaw := $image.resource | resources.Fingerprint "md5" -}}
- {{- $20x := $imageRaw.Fill "20x20 smart" -}}
- <a href="{{ .Permalink }}" class="color-tag"
- data-image="{{ $20x.RelPermalink }}" data-key="{{ $context.Slug }}" data-hash="{{ $imageRaw.Data.Integrity }}">{{ .Title | humanize }}</a>
- {{ else }}
- <a href="{{ printf `categories/%s` (. | urlize) | relLangURL }}">{{ .Title | humanize }}</a>
- {{ end }}
+ {{ $term := $.Site.GetPage (printf "/categories/%s" $category) }}
+ {{ if and $image.exists $image.resource }}
+ {{- $imageRaw := $image.resource | resources.Fingerprint "md5" -}}
+ {{- $20x := $imageRaw.Fill "20x20 smart" -}}
+ <a href="{{ $term.Permalink }}" class="color-tag"
+ data-image="{{ $20x.RelPermalink }}" data-key="{{ $context.Slug }}" data-hash="{{ $imageRaw.Data.Integrity }}">{{ $term.Title | humanize }}</a>
+ {{ else }}
+ <a href="{{ $term.Permalink }}">{{ $term.Title | humanize }}</a>
{{ end }}
{{ end }}
</header>