Files
hugo-theme-stack/layouts/partials/article/components/details.html
T

44 lines
1.4 KiB
HTML
Raw Normal View History

{{ $image := partialCached "helper/image" (dict "Context" . "Type" "article") .RelPermalink "article" }}
{{- $context := . -}}
2020-08-29 11:34:26 +02:00
<div class="article-details">
2020-10-09 19:26:28 +02:00
{{ if .Params.categories }}
2020-08-29 11:34:26 +02:00
<header class="article-category">
2020-10-09 19:26:28 +02:00
{{ range (.GetTerms "categories") }}
{{ if and $image.exists $image.resource }}
{{- $imageRaw := $image.resource | resources.Fingerprint "md5" -}}
{{- $20x := $imageRaw.Fill "20x20 smart" -}}
2020-10-31 23:24:58 +01:00
<a href="{{ .RelPermalink }}"
class="color-tag"
data-image="{{ $20x.RelPermalink }}"
data-key="{{ $context.Slug }}"
data-hash="{{ $imageRaw.Data.Integrity }}">
{{ .LinkTitle }}
</a>
{{ else }}
2020-10-31 23:24:58 +01:00
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
2020-08-29 11:34:26 +02:00
{{ end }}
{{ end }}
</header>
{{ end }}
<h2 class="article-title">
2020-10-31 23:24:58 +01:00
<a href="{{ .RelPermalink }}">
2020-08-29 11:34:26 +02:00
{{- .Title -}}
</a>
</h2>
{{ with .Params.description }}
<h3 class="article-subtitle">
{{ . }}
</h3>
{{ end }}
{{- if not .Date.IsZero -}}
2020-08-29 11:34:26 +02:00
<footer class="article-time">
2020-10-10 00:27:56 +02:00
{{ partial "helper/icon" "clock" }}
<time class="article-time--published">
{{- .Date.Format (or .Site.Params.dateFormat.published "Jan 02, 2006") -}}
2020-08-29 11:34:26 +02:00
</time>
</footer>
{{- end -}}
2020-08-29 11:34:26 +02:00
</div>