diff options
-rw-r--r-- | LICENSE | 20 | ||||
-rw-r--r-- | README.md | 5 | ||||
-rw-r--r-- | archetypes/book.md | 7 | ||||
-rw-r--r-- | archetypes/post.md | 2 | ||||
-rw-r--r-- | assets/css/main.css | 8 | ||||
-rw-r--r-- | config.toml | 8 | ||||
-rw-r--r-- | layouts/book/list.html | 2 | ||||
-rw-r--r-- | layouts/book/single.html | 14 | ||||
-rw-r--r-- | layouts/book/summary.html | 29 | ||||
-rw-r--r-- | layouts/partials/header.html | 8 | ||||
-rw-r--r-- | layouts/post/single.html | 3 |
11 files changed, 68 insertions, 38 deletions
diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 17993f6..0000000 --- a/LICENSE +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | The MIT License (MIT) | ||
2 | |||
3 | Copyright (c) 2023 YOUR_NAME_HERE | ||
4 | |||
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
6 | this software and associated documentation files (the "Software"), to deal in | ||
7 | the Software without restriction, including without limitation the rights to | ||
8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
9 | the Software, and to permit persons to whom the Software is furnished to do so, | ||
10 | subject to the following conditions: | ||
11 | |||
12 | The above copyright notice and this permission notice shall be included in all | ||
13 | copies or substantial portions of the Software. | ||
14 | |||
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
@@ -1,8 +1,7 @@ | |||
1 | # Blackbear, a hugo theme. | 1 | # Blackbear, a hugo theme. |
2 | 2 | ||
3 | 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. | 3 | A hugo theme built from the ground up for my personal site. |
4 | 4 | ||
5 | ## Features | 5 | ## Features |
6 | 6 | ||
7 | - Responsive | 7 | - Responsive \ No newline at end of file |
8 | - Contact form \ 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 @@ | |||
2 | title: "{{ replace .File.ContentBaseName "-" " " | title }}" | 2 | title: "{{ replace .File.ContentBaseName "-" " " | title }}" |
3 | author: "" | 3 | author: "" |
4 | image: "" | 4 | image: "" |
5 | description: "Review and notes for {{ replace .File.ContentBaseName "-" " " | title }} by {{ .Params.author }}" | ||
5 | amazon: "" | 6 | amazon: "" |
6 | rating: 4 | 7 | rating: 4 |
7 | type: 'book' | 8 | type: 'book' |
9 | genres: | ||
10 | - fiction | ||
11 | categories: | ||
12 | - fiction | ||
8 | date: {{ .Date }} | 13 | date: {{ .Date }} |
14 | last_read: ['{{ dateFormat "2006-01-02" .Date }}'] | ||
15 | headless: true | ||
9 | --- \ No newline at end of file | 16 | --- \ 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 @@ | |||
1 | --- | 1 | --- |
2 | title: "{{ replace .File.ContentBaseName "-" " " | title }}" | 2 | title: "{{ replace .File.ContentBaseName "-" " " | title }}" |
3 | date: {{ .Date }} | 3 | date: {{ .Date }} |
4 | image: "" | ||
5 | description: "Thoughts about some topic" | ||
4 | draft: true | 6 | draft: true |
5 | --- | 7 | --- |
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 { | |||
84 | min-width: 250px; | 84 | min-width: 250px; |
85 | } | 85 | } |
86 | 86 | ||
87 | .gap-1 { | ||
88 | gap: 1rem; | ||
89 | } | ||
90 | |||
91 | .wrap { | ||
92 | flex-wrap: wrap; | ||
93 | } | ||
94 | |||
87 | footer { | 95 | footer { |
88 | position:relative; | 96 | position:relative; |
89 | } | 97 | } |
diff --git a/config.toml b/config.toml index c41540e..fb3164e 100644 --- a/config.toml +++ b/config.toml | |||
@@ -1,3 +1,9 @@ | |||
1 | [taxonomies] | ||
2 | _merge = 'deep' | ||
3 | tag = 'tags' | ||
4 | category = 'categories' | ||
5 | genre = 'genres' | ||
6 | |||
1 | [params] | 7 | [params] |
2 | _merge = 'deep' | 8 | _merge = 'deep' |
3 | themeVersion = '0.1' | 9 | 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 @@ | |||
5 | {{ end }} | 5 | {{ end }} |
6 | <section> | 6 | <section> |
7 | {{ if .IsSection }} | 7 | {{ if .IsSection }} |
8 | {{ range sort (.Paginator 3).Pages "Date" "desc" }} | 8 | {{ range sort .Pages "Date" "desc" }} |
9 | {{ if ne .Layout "list" }} | 9 | {{ if ne .Layout "list" }} |
10 | <div>{{ .Render "summary" }}</div> | 10 | <div>{{ .Render "summary" }}</div> |
11 | {{ end }} | 11 | {{ 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 @@ | |||
8 | {{ with .Err }} | 8 | {{ with .Err }} |
9 | {{ errorf "%s" . }} | 9 | {{ errorf "%s" . }} |
10 | {{ else }} | 10 | {{ else }} |
11 | <img | 11 | {{ $image := . }} |
12 | src="{{ .RelPermalink }}" | 12 | {{ $image := $image.Resize "250x" }} |
13 | width="{{ .Width }}" | 13 | <img |
14 | height="{{ .Height }}" | 14 | src="{{ $image.RelPermalink }}" |
15 | alt="Book cover of the book {{ .Title }}" | 15 | width="{{ $image.Width }}" |
16 | /> | 16 | height="{{ $image.Height }}" |
17 | alt="Book cover of the book {{ .Title }}" | ||
18 | /> | ||
17 | {{ end }} | 19 | {{ end }} |
18 | {{ else }} | 20 | {{ else }} |
19 | {{ errorf "unable to get remote resource %q" .Params.image }} | 21 | {{ 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 @@ | |||
1 | <section class="flex row gap-1"> | ||
2 | {{ with resources.GetRemote .Params.image }} | ||
3 | {{ with .Err }} | ||
4 | {{ errorf "%s" . }} | ||
5 | {{ else }} | ||
6 | {{ $image := . }} | ||
7 | {{ $image := $image.Resize "150x" }} | ||
8 | <img | ||
9 | src="{{ $image.RelPermalink }}" | ||
10 | width="{{ $image.Width }}" | ||
11 | height="{{ $image.Height }}" | ||
12 | alt="Book cover of the book {{ .Title }}" | ||
13 | /> | ||
14 | {{ end }} | ||
15 | {{ else }} | ||
16 | {{ errorf "unable to get remote resource %q" .Params.image }} | ||
17 | {{ end }} | ||
18 | <hgroup> | ||
19 | <h3 class="f3 near-black"> | ||
20 | <a href="{{ .RelPermalink }}" class="link black dim"> | ||
21 | {{ .Title }} | ||
22 | </a> | ||
23 | </h3> | ||
24 | <p>Rating: {{ .Params.rating }} / 5</p> | ||
25 | {{ with .Params.last_read }} | ||
26 | <p>Last Read: {{ . | time.Format ":date_full" }}</p> | ||
27 | {{ end }} | ||
28 | </hgroup> | ||
29 | </section> | ||
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 @@ | |||
1 | <header> | 1 | <header> |
2 | <div class="container"> | 2 | <div class="container"> |
3 | <nav> | 3 | <nav id="nav-main" class="flex wrap"> |
4 | <div class='wordmark'> | 4 | <div class='wordmark'> |
5 | {{ .Site.Title }} | 5 | {{ .Site.Title }} |
6 | </div> | 6 | </div> |
7 | <ul> | 7 | <ul> |
8 | {{ range .Site.Menus.main }} | 8 | {{ range .Site.Menus.main }} |
9 | <li><a href="{{ .URL }}">{{ .Name }}</a></li> | 9 | <li><a href="{{ .URL }}">{{ .Name }}</a></li> |
diff --git a/layouts/post/single.html b/layouts/post/single.html index 2c4c23e..ca0f556 100644 --- a/layouts/post/single.html +++ b/layouts/post/single.html | |||
@@ -2,9 +2,6 @@ | |||
2 | {{ if not .Params.dontDisclaim }} | 2 | {{ if not .Params.dontDisclaim }} |
3 | {{ partial "disclaimer" . }} | 3 | {{ partial "disclaimer" . }} |
4 | {{ end }} | 4 | {{ end }} |
5 | {{ with .GetTerms "categories" }} | ||
6 | {{ (index . 0).RelPermalink }} | ||
7 | {{ end }} | ||
8 | <hgroup> | 5 | <hgroup> |
9 | <h1>{{ .Title }}</h1> | 6 | <h1>{{ .Title }}</h1> |
10 | <h6>{{ .Date | time.Format ":date_full" }}</h6> | 7 | <h6>{{ .Date | time.Format ":date_full" }}</h6> |