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 --- archetypes/book.md | 4 +-- archetypes/guide/index.md | 1 + archetypes/project.md | 13 ++++++++++ assets/css/main.css | 5 ++++ layouts/_default/summary.html | 2 +- layouts/book/single.html | 59 +++++++++++++++++++++++++------------------ layouts/book/summary.html | 36 ++++++++++++++++---------- 7 files changed, 79 insertions(+), 41 deletions(-) diff --git a/archetypes/book.md b/archetypes/book.md index 39928c7..069b8a6 100644 --- a/archetypes/book.md +++ b/archetypes/book.md @@ -2,8 +2,8 @@ title: "{{ replace .File.ContentBaseName "-" " " | title }}" author: "" image: "" -description: "Review and notes for {{ replace .File.ContentBaseName "-" " " | title }} by {{ .Params.author }}" -amazon: "" +description: "Review and notes for {{ replace .File.ContentBaseName "-" " " | title }} by " +amazon: null rating: 4 type: 'book' genres: diff --git a/archetypes/guide/index.md b/archetypes/guide/index.md index 00e77bd..34852d1 100644 --- a/archetypes/guide/index.md +++ b/archetypes/guide/index.md @@ -1,6 +1,7 @@ --- title: "{{ replace .Name "-" " " | title }}" date: {{ .Date }} +published: null draft: true --- diff --git a/archetypes/project.md b/archetypes/project.md index 4e1af79..d53dffa 100644 --- a/archetypes/project.md +++ b/archetypes/project.md @@ -7,3 +7,16 @@ categories: ["projects"] dontDisclaim: true description: "An informal specification for the {{ replace .File.ContentBaseName "-" " " | title }} project" --- + +Summary goes here. + + + +## Requirements + +- Responsive. +- Fullscreen. + +## Optional Stretch Requirements + +- Appointment scheduling. \ No newline at end of file diff --git a/assets/css/main.css b/assets/css/main.css index e2f171e..4ba8e63 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -151,4 +151,9 @@ html[data-theme="light"] #actions button { .footnotes p { margin: 0; +} + +.book-notes { + flex-grow: 0; + width: 80ch; } \ No newline at end of file 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" }} +
Links: + 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" }} + 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