From 4d9e9e13014d4ef89038e9e5b12f32a9fdb01c26 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sun, 20 Oct 2024 09:16:43 -0700 Subject: [PATCH] Only include an
in the page summary if there's a description to include Otherwise just use an

. Add .page-summary__heading to both elements and update the styles. --- assets/css/099_page_summary.css | 4 ++-- layouts/_default/page_summary.html | 17 +++++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/assets/css/099_page_summary.css b/assets/css/099_page_summary.css index d96ac67..685bfc7 100644 --- a/assets/css/099_page_summary.css +++ b/assets/css/099_page_summary.css @@ -18,11 +18,11 @@ margin-block-end: var(--space-xl); } - > hgroup { - line-height: 1; + .page-summary__heading { margin-block: 0 var(--space-xs); h2 { + line-height: 1; font-size: var(--text-l); margin-block: 0; } diff --git a/layouts/_default/page_summary.html b/layouts/_default/page_summary.html index 9ac3944..cb18b23 100644 --- a/layouts/_default/page_summary.html +++ b/layouts/_default/page_summary.html @@ -1,18 +1,23 @@
-
-

{{ .LinkTitle | markdownify }}

- {{ if and (.Params.rendersSummary | default true) -}} + {{ if and (.Params.rendersSummary | default true) (gt (len .Description) 0) -}} +
+

{{ .LinkTitle | markdownify }}

{{ with .Description }}

{{ . | markdownify }}

{{ end }} - {{ end }} -
+
+ {{ else }} +

{{ .LinkTitle | markdownify }}

+ {{ end }} + {{- if .Date -}} {{- partial "page/date.html" (dict "page" .) -}} {{- end }} - {{- if ne hugo.Environment "production" -}} + + {{- if not hugo.IsProduction -}} {{ partial "page/taxonomy_draft.html" (dict "page" .) }} {{- end -}} + {{ partial "page/taxonomy_list.html" (dict "page" . "taxonomy" "categories") }} {{ partial "page/taxonomy_list.html" (dict "page" . "taxonomy" "tags") }}