From 6416a7cb1adb60c7dd142abb0204f3751ab36a1f Mon Sep 17 00:00:00 2001 From: Zach Berwaldt Date: Sun, 14 May 2023 17:57:10 -0400 Subject: tweak css, layouts, add new archetype --- layouts/book/single.html | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 layouts/book/single.html (limited to 'layouts/book') diff --git a/layouts/book/single.html b/layouts/book/single.html new file mode 100644 index 0000000..3ffb236 --- /dev/null +++ b/layouts/book/single.html @@ -0,0 +1,26 @@ +{{ define "main" }} +
+

{{ .Title }}

+

{{ .Params.author }}

+
{{ .Date | time.Format ":date_full" }}
+ {{ if isset .Params "image" }} + Book cover of the book {{ .Title }} + {{ end }} + {{ if isset .Params "amazon" }} +

+ amazon +

+ {{ end }} +
+

Rating:

+ {{ if isset .Params "rating" }} + {{ $rating := .Params.rating }} + {{ range $i, $num := (seq $rating) }} + ⭐ + {{ end }} + {{ else }} +

N/A

+ {{ end }} +
+
+{{ end }} \ No newline at end of file -- cgit v1.1 From d0e7f43601e90229b95191a1cdc85039e233b622 Mon Sep 17 00:00:00 2001 From: Zach Berwaldt Date: Mon, 9 Oct 2023 21:08:24 -0400 Subject: add icons, refine styles, update layouts --- layouts/book/list.html | 33 +++++++++++++++++++++++++++++++++ layouts/book/single.html | 15 ++++++++++++++- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 layouts/book/list.html (limited to 'layouts/book') diff --git a/layouts/book/list.html b/layouts/book/list.html new file mode 100644 index 0000000..628d8b8 --- /dev/null +++ b/layouts/book/list.html @@ -0,0 +1,33 @@ +{{ define "main" }} +
+

{{ .Title }}

+ {{ if .Content }} +

{{- .Content -}}

+ {{ end }} +
+ {{ if .IsSection }} + {{ range sort (.Paginator 3).Pages "Date" "desc" }} + {{ if ne .Layout "list" }} +
{{ .Render "summary" }}
+ {{ end }} + {{ end }} + {{ else }} + {{ $metric := .Params.sortby }} + {{ $direction := "asc" }} + {{ if eq .Params.sortby "rating" }} + {{ $direction = "desc" }} + {{ end }} + {{ $pages := (where .Site.RegularPages "Type" "book") }} + {{ $pages = (where $pages "Layout" "!=" "list")}} + {{ if eq $direction "desc" }} + {{ $pages = (sort ($pages.ByParam $metric).Reverse) }} + {{ else }} + {{ $pages = (sort ($pages.ByParam $metric)) }} + {{ end }} + {{ range $pages }} +
{{ .Render "summary" }}
+ {{ end }} + {{ end }} +
+
+{{ end }} \ No newline at end of file diff --git a/layouts/book/single.html b/layouts/book/single.html index 3ffb236..0bbd265 100644 --- a/layouts/book/single.html +++ b/layouts/book/single.html @@ -4,7 +4,20 @@

{{ .Params.author }}

{{ .Date | time.Format ":date_full" }}
{{ if isset .Params "image" }} - Book cover of the book {{ .Title }} + {{ with resources.GetRemote .Params.image }} + {{ with .Err }} + {{ errorf "%s" . }} + {{ else }} + Book cover of the book {{ .Title }} + {{ end }} + {{ else }} + {{ errorf "unable to get remote resource %q" .Params.image }} + {{ end }} {{ end }} {{ if isset .Params "amazon" }}

-- cgit v1.1 From 6e6412e4a693ddc2da5e4611363fb882ad6497be Mon Sep 17 00:00:00 2001 From: Zach Berwaldt Date: Thu, 12 Oct 2023 08:08:37 -0400 Subject: Switch to light theme. remove articles. --- layouts/book/list.html | 2 +- layouts/book/single.html | 61 ++++++++++++++++++++++++------------------------ 2 files changed, 31 insertions(+), 32 deletions(-) (limited to 'layouts/book') diff --git a/layouts/book/list.html b/layouts/book/list.html index 628d8b8..346a918 100644 --- a/layouts/book/list.html +++ b/layouts/book/list.html @@ -2,7 +2,7 @@

{{ .Title }}

{{ if .Content }} -

{{- .Content -}}

+

{{- .Content -}}

{{ end }}
{{ if .IsSection }} diff --git a/layouts/book/single.html b/layouts/book/single.html index 0bbd265..66456e1 100644 --- a/layouts/book/single.html +++ b/layouts/book/single.html @@ -1,39 +1,38 @@ {{ define "main" }} -
+

{{ .Title }}

-

{{ .Params.author }}

{{ .Date | time.Format ":date_full" }}
- {{ if isset .Params "image" }} - {{ with resources.GetRemote .Params.image }} - {{ with .Err }} - {{ errorf "%s" . }} - {{ else }} - Book cover of the book {{ .Title }} - {{ end }} +
+ {{ if isset .Params "image" }} + {{ with resources.GetRemote .Params.image }} + {{ with .Err }} + {{ errorf "%s" . }} {{ else }} - {{ errorf "unable to get remote resource %q" .Params.image }} + Book cover of the book {{ .Title }} {{ end }} + {{ else }} + {{ errorf "unable to get remote resource %q" .Params.image }} + {{ end }} + {{ end }} + {{ if isset .Params "amazon" }} +

+ amazon +

+ {{ end }} +
+

Rating:

+ {{ if isset .Params "rating" }} + {{ $rating := .Params.rating }} + {{ range $i, $num := (seq $rating) }} + ⭐ {{ end }} - {{ if isset .Params "amazon" }} -

- amazon -

+ {{ else }} +

N/A

{{ end }} -
-

Rating:

- {{ if isset .Params "rating" }} - {{ $rating := .Params.rating }} - {{ range $i, $num := (seq $rating) }} - ⭐ - {{ end }} - {{ else }} -

N/A

- {{ end }} -
-
+ {{ end }} \ No newline at end of file -- cgit v1.1 From 2545016f8d6b63b0d857fc20fdd7276d2f0fc2a9 Mon Sep 17 00:00:00 2001 From: Zach Berwaldt Date: Thu, 12 Oct 2023 23:40:26 -0400 Subject: Layout refinements. add config, disclaimer --- layouts/book/list.html | 54 ++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 28 deletions(-) (limited to 'layouts/book') diff --git a/layouts/book/list.html b/layouts/book/list.html index 346a918..d1d1263 100644 --- a/layouts/book/list.html +++ b/layouts/book/list.html @@ -1,33 +1,31 @@ {{ define "main" }} -
-

{{ .Title }}

- {{ if .Content }} -

{{- .Content -}}

- {{ end }} -
- {{ if .IsSection }} - {{ range sort (.Paginator 3).Pages "Date" "desc" }} - {{ if ne .Layout "list" }} -
{{ .Render "summary" }}
- {{ end }} - {{ end }} - {{ else }} - {{ $metric := .Params.sortby }} - {{ $direction := "asc" }} - {{ if eq .Params.sortby "rating" }} - {{ $direction = "desc" }} - {{ end }} - {{ $pages := (where .Site.RegularPages "Type" "book") }} - {{ $pages = (where $pages "Layout" "!=" "list")}} - {{ if eq $direction "desc" }} - {{ $pages = (sort ($pages.ByParam $metric).Reverse) }} - {{ else }} - {{ $pages = (sort ($pages.ByParam $metric)) }} - {{ end }} - {{ range $pages }} +

{{ .Title }}

+ {{ if .Content }} +

{{- .Content -}}

+ {{ end }} +
+ {{ if .IsSection }} + {{ range sort (.Paginator 3).Pages "Date" "desc" }} + {{ if ne .Layout "list" }}
{{ .Render "summary" }}
{{ end }} {{ end }} -
-
+ {{ else }} + {{ $metric := .Params.sortby }} + {{ $direction := "asc" }} + {{ if eq .Params.sortby "rating" }} + {{ $direction = "desc" }} + {{ end }} + {{ $pages := (where .Site.RegularPages "Type" "book") }} + {{ $pages = (where $pages "Layout" "!=" "list")}} + {{ if eq $direction "desc" }} + {{ $pages = (sort ($pages.ByParam $metric).Reverse) }} + {{ else }} + {{ $pages = (sort ($pages.ByParam $metric)) }} + {{ end }} + {{ range $pages }} +
{{ .Render "summary" }}
+ {{ end }} + {{ end }} +
{{ end }} \ No newline at end of file -- cgit v1.1 From 6bfd84ae2c7aad006c3bc84cdce9aebf894cbe62 Mon Sep 17 00:00:00 2001 From: user Date: Fri, 20 Oct 2023 22:49:31 -0400 Subject: add summary for books --- layouts/book/list.html | 2 +- layouts/book/single.html | 14 ++++++++------ layouts/book/summary.html | 29 +++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 layouts/book/summary.html (limited to 'layouts/book') diff --git a/layouts/book/list.html b/layouts/book/list.html index d1d1263..25976dd 100644 --- a/layouts/book/list.html +++ b/layouts/book/list.html @@ -5,7 +5,7 @@ {{ end }}
{{ if .IsSection }} - {{ range sort (.Paginator 3).Pages "Date" "desc" }} + {{ range sort .Pages "Date" "desc" }} {{ if ne .Layout "list" }}
{{ .Render "summary" }}
{{ end }} diff --git a/layouts/book/single.html b/layouts/book/single.html index 66456e1..baedf32 100644 --- a/layouts/book/single.html +++ b/layouts/book/single.html @@ -8,12 +8,14 @@ {{ with .Err }} {{ errorf "%s" . }} {{ else }} - Book cover of the book {{ .Title }} + {{ $image := . }} + {{ $image := $image.Resize "250x" }} + Book cover of the book {{ .Title }} {{ end }} {{ else }} {{ errorf "unable to get remote resource %q" .Params.image }} diff --git a/layouts/book/summary.html b/layouts/book/summary.html new file mode 100644 index 0000000..900fb87 --- /dev/null +++ b/layouts/book/summary.html @@ -0,0 +1,29 @@ +
+ {{ with resources.GetRemote .Params.image }} + {{ with .Err }} + {{ errorf "%s" . }} + {{ else }} + {{ $image := . }} + {{ $image := $image.Resize "150x" }} + Book cover of the book {{ .Title }} + {{ end }} + {{ else }} + {{ errorf "unable to get remote resource %q" .Params.image }} + {{ end }} +
+

+ + {{ .Title }} + +

+

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

+ {{ with .Params.last_read }} +

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

+ {{ end }} +
+
-- cgit v1.1