fix: do not display the date of term pages (#1296)

This commit is contained in:
Jimmy
2026-03-05 18:25:04 +01:00
committed by GitHub
parent 07fa7615eb
commit f5adf4a273
+8 -4
View File
@@ -11,14 +11,18 @@
{{- $description = $description | default (T "list.page" (len .Pages)) -}}
{{- end -}}
{{- if or $description (not .Date.IsZero) -}}
{{/*
If it's a term, the date is extracted from the first page of the collection, which is not very useful.
In that case, we prefer to display the description (if set), or the number of pages within the collection.
*/}}
<footer class="article-meta">
{{- if not .Date.IsZero -}}
{{- if or $IsTerm .Date.IsZero -}}
<span class="article-description">{{- $description -}}</span>
{{- else if not .Date.IsZero -}}
<time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
{{- .Date | time.Format .Site.Params.dateFormat.published -}}
</time>
{{- else if $description -}}
<span class="article-description">{{- $description -}}</span>
{{ end }}
{{- end }}
</footer>
{{- end -}}
</div>