From 920c3cce3e7004718c997045c05501a00195f056 Mon Sep 17 00:00:00 2001 From: Wang Chucheng Date: Sun, 3 Oct 2021 22:58:19 -0400 Subject: [PATCH] fix: display description when exists Closes #136 --- layouts/partials/components/summary-masonry.html | 6 +++++- layouts/partials/utils/get-summary.html | 12 ++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/layouts/partials/components/summary-masonry.html b/layouts/partials/components/summary-masonry.html index 2e258543..4027f7a3 100644 --- a/layouts/partials/components/summary-masonry.html +++ b/layouts/partials/components/summary-masonry.html @@ -8,7 +8,11 @@ {{ .LinkTitle }}
- {{- .Summary | plainify -}} + {{ if .Description }} + {{ .Description | plainify | htmlUnescape }} + {{ else if .Summary }} + {{ .Summary | plainify | htmlUnescape }} + {{ end }}
diff --git a/layouts/partials/utils/get-summary.html b/layouts/partials/utils/get-summary.html index 82a43edc..55eb35c8 100644 --- a/layouts/partials/utils/get-summary.html +++ b/layouts/partials/utils/get-summary.html @@ -2,7 +2,11 @@ {{ .LinkTitle }}
- {{ .Summary | plainify | htmlUnescape }} + {{ if .Description }} + {{ .Description | plainify | htmlUnescape }} + {{ else if .Summary }} + {{ .Summary | plainify | htmlUnescape }} + {{ end }}
{{ if eq .Type "docs" }}
@@ -15,7 +19,11 @@ {{ .LinkTitle }}
- {{- .Summary | plainify | htmlUnescape -}} + {{ if .Description }} + {{ .Description | plainify | htmlUnescape }} + {{ else if .Summary }} + {{ .Summary | plainify | htmlUnescape }} + {{ end }}
{{ end }}