From b65ae080d9021e0c19902d83c32556104bd36a14 Mon Sep 17 00:00:00 2001 From: Rickard Andersson Date: Tue, 11 Mar 2025 12:36:37 +0100 Subject: [PATCH 1/5] Add copy of summary-with-image.html from theme into our layours folder --- layouts/_default/summary-with-image.html | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 layouts/_default/summary-with-image.html diff --git a/layouts/_default/summary-with-image.html b/layouts/_default/summary-with-image.html new file mode 100644 index 0000000..d6a88ce --- /dev/null +++ b/layouts/_default/summary-with-image.html @@ -0,0 +1,29 @@ +{{ $featured_image := partial "func/GetFeaturedImage.html" . }} +
+
+
+ {{ if $featured_image }} + {{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}} +
+ + image from {{ .Title }} + +
+ {{ end }} +
+

+ + {{ .Title }} + +

+ + {{ with .Params.author | default .Site.Params.author }} +

By {{ . }}

+ {{- end -}} + {{ $.Param "read_more_copy" | default (i18n "readMore") }} +
+
+
+
From 1d33a6ee1134baaf85d86b31aeb277cfbc4526b1 Mon Sep 17 00:00:00 2001 From: Rickard Andersson Date: Tue, 11 Mar 2025 12:38:48 +0100 Subject: [PATCH 2/5] Render multiple authors in summary --- layouts/_default/summary-with-image.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/layouts/_default/summary-with-image.html b/layouts/_default/summary-with-image.html index d6a88ce..750c1a3 100644 --- a/layouts/_default/summary-with-image.html +++ b/layouts/_default/summary-with-image.html @@ -20,7 +20,14 @@

{{ .Summary }} {{ with .Params.author | default .Site.Params.author }} -

By {{ . }}

+

+ By  + {{- if reflect.IsSlice . -}} + {{ delimit . ", " | markdownify }} + {{- else -}} + {{ . | markdownify }} + {{- end -}} +

{{- end -}} {{ $.Param "read_more_copy" | default (i18n "readMore") }} From 00c671e46d845e1f5152408878827cb82de4ac2d Mon Sep 17 00:00:00 2001 From: Rickard Andersson Date: Tue, 11 Mar 2025 12:45:09 +0100 Subject: [PATCH 3/5] Add custom date back --- layouts/_default/summary-with-image.html | 12 ++++-------- layouts/partials/multiple-authors.html | 6 ++++++ 2 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 layouts/partials/multiple-authors.html diff --git a/layouts/_default/summary-with-image.html b/layouts/_default/summary-with-image.html index 750c1a3..d4584be 100644 --- a/layouts/_default/summary-with-image.html +++ b/layouts/_default/summary-with-image.html @@ -16,18 +16,14 @@

{{ .Title }}

+ {{ partial "custom-date.html" . }} {{ with .Params.author | default .Site.Params.author }} -

- By  - {{- if reflect.IsSlice . -}} - {{ delimit . ", " | markdownify }} - {{- else -}} - {{ . | markdownify }} - {{- end -}} -

+

+ {{ partial "multiple-authors.html" . }} +

{{- end -}} {{ $.Param "read_more_copy" | default (i18n "readMore") }} diff --git a/layouts/partials/multiple-authors.html b/layouts/partials/multiple-authors.html new file mode 100644 index 0000000..39794b6 --- /dev/null +++ b/layouts/partials/multiple-authors.html @@ -0,0 +1,6 @@ +By  +{{- if reflect.IsSlice . -}} + {{ delimit . ", " | markdownify }} +{{- else -}} + {{ . | markdownify }} +{{- end -}} From d141894f0a33e36e04c1cf5e354b745736c84d18 Mon Sep 17 00:00:00 2001 From: Rickard Andersson Date: Tue, 11 Mar 2025 12:49:54 +0100 Subject: [PATCH 4/5] Fix date in list view --- layouts/{partials => _default}/summary.html | 5 ++-- layouts/partials/summary-with-image.html | 30 --------------------- 2 files changed, 3 insertions(+), 32 deletions(-) rename layouts/{partials => _default}/summary.html (56%) delete mode 100644 layouts/partials/summary-with-image.html diff --git a/layouts/partials/summary.html b/layouts/_default/summary.html similarity index 56% rename from layouts/partials/summary.html rename to layouts/_default/summary.html index ba5df27..7ecb9b2 100644 --- a/layouts/partials/summary.html +++ b/layouts/_default/summary.html @@ -1,6 +1,6 @@ diff --git a/layouts/partials/summary-with-image.html b/layouts/partials/summary-with-image.html deleted file mode 100644 index 15fa5c2..0000000 --- a/layouts/partials/summary-with-image.html +++ /dev/null @@ -1,30 +0,0 @@ -{{ $featured_image := partial "func/GetFeaturedImage.html" . }} -
-
-
- {{ if $featured_image }} - {{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}} - {{ $featured_image := (trim $featured_image "/") | absURL }} -
- - image from {{ .Title }} - -
- {{ end }} -
-

- - {{ .Title }} - -

- {{ partial "custom-date.html" . }} - - {{ $.Param "read_more_copy" | default (i18n "readMore") }} - {{/* TODO: add author -

By {{ .Author }}

*/}} -
-
-
-
From db84d628e649daf1027b6377eb91486dbcfc2463 Mon Sep 17 00:00:00 2001 From: Rickard Andersson Date: Tue, 11 Mar 2025 12:51:03 +0100 Subject: [PATCH 5/5] Add author to /posts view --- layouts/_default/summary.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html index 7ecb9b2..03828c6 100644 --- a/layouts/_default/summary.html +++ b/layouts/_default/summary.html @@ -10,6 +10,11 @@

+ {{ with .Params.author | default .Site.Params.author }} +

+ {{ partial "multiple-authors.html" . }} +

+ {{- end -}} {{ $.Param "read_more_copy" | default (i18n "readMore") }}