mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2024-11-27 04:03:48 +01:00
fix(article/details): fix custom taxonomy link
This commit is contained in:
parent
b2a1afd744
commit
117dd4b81e
1 changed files with 8 additions and 9 deletions
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue