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 --- LICENSE | 20 -------------------- README.md | 5 ++--- archetypes/book.md | 7 +++++++ archetypes/post.md | 2 ++ assets/css/main.css | 8 ++++++++ config.toml | 8 +++++++- layouts/book/list.html | 2 +- layouts/book/single.html | 14 ++++++++------ layouts/book/summary.html | 29 +++++++++++++++++++++++++++++ layouts/partials/header.html | 8 ++++---- layouts/post/single.html | 3 --- 11 files changed, 68 insertions(+), 38 deletions(-) delete mode 100644 LICENSE create mode 100644 layouts/book/summary.html diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 17993f6..0000000 --- a/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2023 YOUR_NAME_HERE - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index 597b8b4..e1e8bb1 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,7 @@ # Blackbear, a hugo theme. -A hugo theme built from the ground up for my personal site. It is not open source. You do not have permission to use it. +A hugo theme built from the ground up for my personal site. ## Features -- Responsive -- Contact form \ No newline at end of file +- Responsive \ No newline at end of file diff --git a/archetypes/book.md b/archetypes/book.md index 1c79e82..39928c7 100644 --- a/archetypes/book.md +++ b/archetypes/book.md @@ -2,8 +2,15 @@ title: "{{ replace .File.ContentBaseName "-" " " | title }}" author: "" image: "" +description: "Review and notes for {{ replace .File.ContentBaseName "-" " " | title }} by {{ .Params.author }}" amazon: "" rating: 4 type: 'book' +genres: + - fiction +categories: + - fiction date: {{ .Date }} +last_read: ['{{ dateFormat "2006-01-02" .Date }}'] +headless: true --- \ No newline at end of file diff --git a/archetypes/post.md b/archetypes/post.md index 43dca9a..304e9f5 100644 --- a/archetypes/post.md +++ b/archetypes/post.md @@ -1,5 +1,7 @@ --- title: "{{ replace .File.ContentBaseName "-" " " | title }}" date: {{ .Date }} +image: "" +description: "Thoughts about some topic" draft: true --- diff --git a/assets/css/main.css b/assets/css/main.css index 47cb5f5..fff7794 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -84,6 +84,14 @@ main { min-width: 250px; } +.gap-1 { + gap: 1rem; +} + +.wrap { + flex-wrap: wrap; +} + footer { position:relative; } diff --git a/config.toml b/config.toml index c41540e..fb3164e 100644 --- a/config.toml +++ b/config.toml @@ -1,3 +1,9 @@ +[taxonomies] + _merge = 'deep' + tag = 'tags' + category = 'categories' + genre = 'genres' + [params] _merge = 'deep' - themeVersion = '0.1' + themeVersion = '0.1' \ No newline at end of file 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 }} +
+
diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 28d3734..0137db1 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -1,9 +1,9 @@
-