From e96aff653fe034a6c6e12280bd39c04197b501a9 Mon Sep 17 00:00:00 2001 From: Zach Berwaldt Date: Sun, 5 Nov 2023 14:46:24 -0500 Subject: modifications to css, layouts, and archetypes --- layouts/book/summary.html | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) (limited to 'layouts/book/summary.html') diff --git a/layouts/book/summary.html b/layouts/book/summary.html index 56f2ea7..69419e0 100644 --- a/layouts/book/summary.html +++ b/layouts/book/summary.html @@ -1,19 +1,26 @@
- {{ with resources.GetRemote .Params.image }} - {{ with .Err }} - {{ errorf "%s" . }} + {{ if isset .Params "image" }} + {{ with resources.GetRemote .Params.image }} + {{ with .Err }} + {{ errorf "%s" . }} + {{ else }} + {{ $image := . }} + {{ $image := $image.Resize "150x" }} + Book cover of the book {{ .Title }} + {{ end }} {{ else }} - {{ $image := . }} - {{ $image := $image.Resize "150x" }} - Book cover of the book {{ .Title }} + {{ errorf "unable to get remote resource %q" .Params.image }} {{ end }} {{ else }} - {{ errorf "unable to get remote resource %q" .Params.image }} +
{{ end }}

@@ -27,7 +34,10 @@

Rating: {{ .Params.rating }} / 5

{{ with .Params.last_read }} -

Last Read: {{ . | time.Format ":date_full" }}

+ {{ $last := index (.) 0 }} + {{/* if last_read is an array get the first item */}} + +

Last Read: {{ $last | time.Format ":date_full" }}

{{ end }}
-- cgit v1.1