Files
Blog/layouts/partials/article/components/details.html
Vezpi 3de1290d1c
All checks were successful
Blog Test / Check-Rebuild (push) Successful in 7s
Blog Test / Build (push) Has been skipped
Blog Test / Deploy-Test (push) Successful in 11s
Blog Test / Test (push) Successful in 3s
fix: RelPermalink
2026-04-03 12:40:27 +00:00

67 lines
2.4 KiB
HTML

{{- $IsList := .IsList -}}
{{- $Page := .Page -}}
<div class="article-details">
{{ if $Page.Params.categories }}
<header class="article-category">
{{ range ($Page.GetTerms "tags") }}
{{ $color := partial "helper/color-from-str" .LinkTitle }}
{{ $BackgroundColor := default $color.BackgroundColor .Params.style.background }}
{{ $TextColor := default $color.TextColor .Params.style.color }}
<a href="{{ $Page.RelPermalink }}" style="background-color: {{ $BackgroundColor | safeCSS }}; color: {{ $TextColor | safeCSS }};">
{{ .LinkTitle }}
</a>
{{ end }}
</header>
{{ end }}
<div class="article-title-wrapper">
<h2 class="article-title">
<a href="{{ $Page.RelPermalink }}">
{{- $Page.Title -}}
</a>
</h2>
{{ with $Page.Params.description }}
<h3 class="article-subtitle">
{{ . }}
</h3>
{{ end }}
</div>
{{ $showReadingTime := $Page.Params.readingTime | default ($Page.Site.Params.article.readingTime) }}
{{ $showDate := not $Page.Date.IsZero }}
{{ $showTime := or $showDate $showReadingTime }}
{{ if $showTime }}
<footer class="article-meta">
<div class="inline-meta">
{{ if $showDate }}
{{ partial "helper/icon" "date" }}
<time class="article-time--published" datetime='{{ $Page.Date.Format "2006-01-02T15:04:05Z07:00" }}'>
{{- $Page.Date | time.Format $Page.Site.Params.dateFormat.published -}}
</time>
{{ end }}
{{ if $showReadingTime }}
{{ partial "helper/icon" "clock" }}
<time class="article-time--reading">
{{ T "article.readingTime" $Page.ReadingTime }}
</time>
{{ end }}
{{- $date := $Page.Date.Format "20060102" | int -}}
{{- $lastmod := $Page.Lastmod.Format "20060102" | int -}}
{{- if gt $lastmod $date -}}
<div class="article-lastmod">
{{ partial "helper/icon" "refresh" }}
<time>
{{ T "article.lastUpdatedOn" }} {{ $Page.Lastmod | time.Format ( or $Page.Site.Params.dateFormat.lastUpdated "Jan 02, 2006 15:04 MST" ) }}
</time>
</div>
{{- end -}}
</div>
</footer>
{{ end }}
</div>