Skip to content

Commit f5adf4a

Browse files
authored
fix: do not display the date of term pages (#1296)
1 parent 07fa761 commit f5adf4a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

layouts/_partials/article-list/compact.html

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,18 @@ <h2 class="article-title">
1111
{{- $description = $description | default (T "list.page" (len .Pages)) -}}
1212
{{- end -}}
1313
{{- if or $description (not .Date.IsZero) -}}
14+
{{/*
15+
If it's a term, the date is extracted from the first page of the collection, which is not very useful.
16+
In that case, we prefer to display the description (if set), or the number of pages within the collection.
17+
*/}}
1418
<footer class="article-meta">
15-
{{- if not .Date.IsZero -}}
19+
{{- if or $IsTerm .Date.IsZero -}}
20+
<span class="article-description">{{- $description -}}</span>
21+
{{- else if not .Date.IsZero -}}
1622
<time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
1723
{{- .Date | time.Format .Site.Params.dateFormat.published -}}
1824
</time>
19-
{{- else if $description -}}
20-
<span class="article-description">{{- $description -}}</span>
21-
{{ end }}
25+
{{- end }}
2226
</footer>
2327
{{- end -}}
2428
</div>

0 commit comments

Comments
 (0)