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-12-22 21:43:14 +0300
committerGitHub <noreply@github.com>2020-12-22 21:43:14 +0300
commite606dca404d5bf1d8e29555b7e89b553b0508e0f (patch)
tree435f1ede461873b344e9c6d351b50a845b152741 /layouts/partials/article/components/details.html
parent31c42bcfe7e93ab30843b000f4094b618ebf3e7a (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.html18
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 }}