From 83e9267996c98b993d1ef5290f794d6c7b38ed3b Mon Sep 17 00:00:00 2001 From: Mason Wilde Date: Sat, 28 Oct 2023 14:20:30 -0600 Subject: [PATCH] Add logic to use .Description instead of .Summary Adds a check for a useDescription param which will check for a description field in a post and use it instead of the .Summary when producing list.html. If a description is unavailable and hideSummary is not true, the summary will show as normal. --- layouts/_default/list.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 9c5bc54d..56eb20ad 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -72,7 +72,11 @@ {{- if .Draft }}  [draft]{{- end }} - {{- if (ne (.Param "hideSummary") true) }} + {{- if and (.Description) (.Param "useDescription") }} +
+

{{ .Description | plainify | htmlUnescape }}

+
+ {{- else if (ne (.Param "hideSummary") true) }}

{{ .Summary | plainify | htmlUnescape }}{{ if .Truncated }}...{{ end }}