Hugo-theme-stack/layouts/partials/article/components/details.html

38 lines
1.3 KiB
HTML
Raw Normal View History

{{ $i := .Params.image }}
{{ $context := . }}
<div class="article-details">
{{ with $categories := .Params.categories }}
<header class="article-category">
{{ range $categories }}
{{ if $i }}
{{- $image := partial "helper/image" $context | resources.Fingerprint "md5" -}}
{{- $20x := $image.Fill "20x20 smart" -}}
<a href="/categories/{{ . | urlize }}" class="color-tag"
data-image="{{ $20x.RelPermalink }}" data-id="{{ $context.Slug }}" data-key="{{ $image.Data.Integrity }}">{{ . | humanize }}</a>
{{ else }}
<a href="/categories/{{ . | urlize }}">{{ . | humanize }}</a>
{{ end }}
{{ end }}
</header>
{{ end }}
<h2 class="article-title">
<a href="{{ .Permalink }}">
{{- .Title -}}
</a>
</h2>
{{ with .Params.description }}
<h3 class="article-subtitle">
{{ . }}
</h3>
{{ end }}
<footer class="article-time">
{{ (resources.Get "icons/clock.svg").Content | safeHTML }}
<time data-timeago="true" datetime='{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}'>
{{- .Date.Format ( or .Site.Params.dateFormat "Jan 02, 2006" ) -}}
</time>
</footer>
</div>