From 1ffbec86e9da93d2ef1e0cdba50d9a5603db3afc Mon Sep 17 00:00:00 2001 From: Thomas Staudinger Date: Tue, 10 Dec 2024 21:51:57 +0100 Subject: [PATCH] blog: Split summaries into paragraphs so they're properly (un)formatted Except for paragraph splits Signed-off-by: Thomas Staudinger --- themes/blog/layouts/blog/list.html | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/themes/blog/layouts/blog/list.html b/themes/blog/layouts/blog/list.html index a746d05..9832e1e 100755 --- a/themes/blog/layouts/blog/list.html +++ b/themes/blog/layouts/blog/list.html @@ -8,12 +8,19 @@
{{ partial "blog/info.html" (dict "blog" $firstBlog "site" .Site) }} -
{{- safeHTML $firstBlog.Summary -}}
- + + {{ $summaryParagraphs := split $firstBlog.Summary "

" }} + {{range $summaryParagraphs }} + {{ if eq . "" }} + {{ continue }} + {{ end }} +

{{ htmlUnescape (plainify (safeHTML .)) }}

+ {{end}} +
{{ $url := (printf "%s/%s" $firstBlog.Params.url $firstBlog.Params.featuredimage) | absURL }} {{ $firstBlog.Title }}