feat(article): add support for custom taxonomy link
This commit is contained in:
@@ -1,16 +1,19 @@
|
||||
{{ $image := partialCached "helper/image" (dict "Context" .) .RelPermalink }}
|
||||
{{ $context := . }}
|
||||
{{- $image := partialCached "helper/image" (dict "Context" .) .RelPermalink -}}
|
||||
{{- $context := . -}}
|
||||
{{- $categories := .Params.categories -}}
|
||||
<div class="article-details">
|
||||
{{ with $categories := .Params.categories }}
|
||||
{{ if $categories }}
|
||||
<header class="article-category">
|
||||
{{ range $categories }}
|
||||
{{ if and $image.exists $image.resource }}
|
||||
{{- $imageRaw := $image.resource | resources.Fingerprint "md5" -}}
|
||||
{{- $20x := $imageRaw.Fill "20x20 smart" -}}
|
||||
<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="{{ printf `categories/%s` (. | urlize) | relLangURL }}">{{ . | humanize }}</a>
|
||||
{{ 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 }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</header>
|
||||
|
||||
Reference in New Issue
Block a user