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/_default/summary.html | 2 +-
layouts/book/single.html | 59 +++++++++++++++++++++++++------------------
layouts/book/summary.html | 36 ++++++++++++++++----------
3 files changed, 58 insertions(+), 39 deletions(-)
(limited to 'layouts')
diff --git a/layouts/_default/summary.html b/layouts/_default/summary.html
index 48c7b97..1f203a1 100644
--- a/layouts/_default/summary.html
+++ b/layouts/_default/summary.html
@@ -13,5 +13,5 @@
{{ .ReadingTime }} min read
- {{ .Summary | markdownify }}
+ {{ .Summary }}
diff --git a/layouts/book/single.html b/layouts/book/single.html
index 9179523..f025d92 100644
--- a/layouts/book/single.html
+++ b/layouts/book/single.html
@@ -1,9 +1,7 @@
{{ define "main" }}
-
- {{ .Title }}
- {{ .Date | time.Format ":date_full" }}
-
+
{{ if isset .Params "image" }}
+
{{ with resources.GetRemote .Params.image }}
{{ with .Err }}
{{ errorf "%s" . }}
@@ -20,28 +18,39 @@
{{ else }}
{{ errorf "unable to get remote resource %q" .Params.image }}
{{ end }}
+
+
+
{{ end }}
-
-
Rating:
- {{ if isset .Params "rating" }}
- {{ $rating := .Params.rating }}
- {{ range (seq $rating) }}
- ⭐
- {{ end }}
- {{ $diff := sub 5 $rating }}
- {{ range (seq $diff) }}
- ☆
- {{ end }}
- {{ else }}
-
N/A
- {{ end }}
-
- {{ if isset .Params "amazon" }}
-
- amazon
-
- {{ end }}
-
+
+
+ {{ .Title }}
+ {{ with .Params.last_read }}
+ {{ $last := index (.) 0 }}
+ {{/* if last_read is an array get the first item */}}
+ Finished on: {{ $last | time.Format ":date_full" }}
+ {{ end }}
+ Rating:
+ {{ if isset .Params "rating" }}
+ {{ $rating := .Params.rating }}
+ {{ range (seq $rating) }}
+ ⭐
+ {{ end }}
+ {{ $diff := sub 5 $rating }}
+ {{ range (seq $diff) }}
+ ☆
+ {{ end }}
+ {{ else }}
+ N/A
+ {{ end }}
+
+ {{ if isset .Params "amazon" }}
+
+ {{ end }}
+
{{- .Content -}}
+
{{ end }}
\ No newline at end of file
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" }}
+
+ {{ end }}
{{ else }}
- {{ $image := . }}
- {{ $image := $image.Resize "150x" }}
-
+ {{ 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