From 12f05571cf616255e4d0862ea121eed1aa14c6f8 Mon Sep 17 00:00:00 2001 From: Jimmy Date: Thu, 5 Mar 2026 13:43:55 +0100 Subject: [PATCH] refactor: make `article-list/compact` better for term pages (#1289) * refactor: rename article-time class to article-footer for consistency * feat: show the number of subpages in `article-compact` when the page is a term --- assets/scss/partials/article.scss | 4 ++-- layouts/_partials/article-list/compact.html | 22 ++++++++++++++----- .../_partials/article/components/details.html | 2 +- .../_partials/article/components/links.html | 2 +- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/assets/scss/partials/article.scss b/assets/scss/partials/article.scss index 41a6d94..7ec6270 100644 --- a/assets/scss/partials/article.scss +++ b/assets/scss/partials/article.scss @@ -71,7 +71,7 @@ gap: 8px; } -.article-time, +.article-footer, .article-translations, .article-header-tags { display: flex; @@ -173,7 +173,7 @@ } } - .article-time { + .article-footer { font-size: 1.4rem; } diff --git a/layouts/_partials/article-list/compact.html b/layouts/_partials/article-list/compact.html index f110e90..78b6e8b 100644 --- a/layouts/_partials/article-list/compact.html +++ b/layouts/_partials/article-list/compact.html @@ -4,11 +4,23 @@

{{- .Title -}}

- + + {{- $description := .Params.description -}} + {{- $IsTerm := in .Kind "term" -}} + {{- if $IsTerm -}} + {{- $description = $description | default (T "list.page" (len .Pages)) -}} + {{- end -}} + {{- if or $description (not .Date.IsZero) -}} + + {{- end -}} {{- $image := partial "helper/image" (dict "Image" .Params.image "Resources" .Resources) -}} diff --git a/layouts/_partials/article/components/details.html b/layouts/_partials/article/components/details.html index 1482cb1..5745f7a 100644 --- a/layouts/_partials/article/components/details.html +++ b/layouts/_partials/article/components/details.html @@ -32,7 +32,7 @@ {{ $showDate := not $Page.Date.IsZero }} {{ $showFooter := or $showDate $showReadingTime }} {{ if $showFooter }} -