diff options
author | Jimmy Cai <jimmehcai@gmail.com> | 2020-12-22 21:43:14 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-22 21:43:14 +0300 |
commit | e606dca404d5bf1d8e29555b7e89b553b0508e0f (patch) | |
tree | 435f1ede461873b344e9c6d351b50a845b152741 /layouts/partials/article/components/details.html | |
parent | 31c42bcfe7e93ab30843b000f4094b618ebf3e7a (diff) |
refactor(article): remove color tag & add custom category color (#75)
closes: https://github.com/CaiJimmy/hugo-theme-stack/issues/71
Diffstat (limited to 'layouts/partials/article/components/details.html')
-rw-r--r-- | layouts/partials/article/components/details.html | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/layouts/partials/article/components/details.html b/layouts/partials/article/components/details.html index 7650704..5c5397b 100644 --- a/layouts/partials/article/components/details.html +++ b/layouts/partials/article/components/details.html @@ -1,22 +1,10 @@ -{{ $image := partialCached "helper/image" (dict "Context" . "Type" "article") .RelPermalink "article" }} -{{- $context := . -}} <div class="article-details"> {{ if .Params.categories }} <header class="article-category"> {{ range (.GetTerms "categories") }} - {{ if and $image.exists $image.resource }} - {{- $imageRaw := $image.resource | resources.Fingerprint "md5" -}} - {{- $20x := $imageRaw.Fill "20x20 smart" -}} - <a href="{{ .RelPermalink }}" - class="color-tag" - data-image="{{ $20x.RelPermalink }}" - data-key="{{ $context.Slug }}" - data-hash="{{ $imageRaw.Data.Integrity }}"> - {{ .LinkTitle }} - </a> - {{ else }} - <a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a> - {{ end }} + <a href="{{ .RelPermalink }}" {{ with .Params.style }}style="background-color: {{ .background }}; color: {{ .color }};"{{ end }}> + {{ .LinkTitle }} + </a> {{ end }} </header> {{ end }} |