aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archetypes/book.md4
-rw-r--r--archetypes/guide/index.md1
-rw-r--r--archetypes/project.md13
-rw-r--r--assets/css/main.css5
-rw-r--r--layouts/_default/summary.html2
-rw-r--r--layouts/book/single.html59
-rw-r--r--layouts/book/summary.html36
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 @@
2title: "{{ replace .File.ContentBaseName "-" " " | title }}" 2title: "{{ replace .File.ContentBaseName "-" " " | title }}"
3author: "" 3author: ""
4image: "" 4image: ""
5description: "Review and notes for {{ replace .File.ContentBaseName "-" " " | title }} by {{ .Params.author }}" 5description: "Review and notes for {{ replace .File.ContentBaseName "-" " " | title }} by <author goes here>"
6amazon: "" 6amazon: null
7rating: 4 7rating: 4
8type: 'book' 8type: 'book'
9genres: 9genres:
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 @@
1--- 1---
2title: "{{ replace .Name "-" " " | title }}" 2title: "{{ replace .Name "-" " " | title }}"
3date: {{ .Date }} 3date: {{ .Date }}
4published: null
4draft: true 5draft: true
5--- 6---
6 7
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"]
7dontDisclaim: true 7dontDisclaim: true
8description: "An informal specification for the {{ replace .File.ContentBaseName "-" " " | title }} project" 8description: "An informal specification for the {{ replace .File.ContentBaseName "-" " " | title }} project"
9--- 9---
10
11Summary goes here.
12
13<!--more-->
14
15## Requirements
16
17- Responsive.
18- Fullscreen.
19
20## Optional Stretch Requirements
21
22- 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 {
151 151
152.footnotes p { 152.footnotes p {
153 margin: 0; 153 margin: 0;
154}
155
156.book-notes {
157 flex-grow: 0;
158 width: 80ch;
154} \ No newline at end of file 159} \ 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 @@
13 <span>{{ .ReadingTime }} min read</span> 13 <span>{{ .ReadingTime }} min read</span>
14 </p> 14 </p>
15 </hgroup> 15 </hgroup>
16 <div>{{ .Summary | markdownify }}</div> 16 <div>{{ .Summary }}</div>
17</section> 17</section>
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 @@
1{{ define "main" }} 1{{ define "main" }}
2 <hgroup> 2<div class="flex row gap-1">
3 <h1>{{ .Title }}</h1>
4 <h6>{{ .Date | time.Format ":date_full" }}</h6>
5 </hgroup>
6 {{ if isset .Params "image" }} 3 {{ if isset .Params "image" }}
4 <figure>
7 {{ with resources.GetRemote .Params.image }} 5 {{ with resources.GetRemote .Params.image }}
8 {{ with .Err }} 6 {{ with .Err }}
9 {{ errorf "%s" . }} 7 {{ errorf "%s" . }}
@@ -20,28 +18,39 @@
20 {{ else }} 18 {{ else }}
21 {{ errorf "unable to get remote resource %q" .Params.image }} 19 {{ errorf "unable to get remote resource %q" .Params.image }}
22 {{ end }} 20 {{ end }}
21 <figcaption>
22 </figcaption>
23 </figure>
23 {{ end }} 24 {{ end }}
24 <div class="flex row gap-1"> 25 <div class="book-notes">
25 <strong>Rating:</strong> 26 <hgroup>
26 {{ if isset .Params "rating" }} 27 <h1>{{ .Title }}</h1>
27 {{ $rating := .Params.rating }} 28 {{ with .Params.last_read }}
28 {{ range (seq $rating) }} 29 {{ $last := index (.) 0 }}
29 30 {{/* if last_read is an array get the first item */}}
30 {{ end }} 31 <h6>Finished on: {{ $last | time.Format ":date_full" }}</h6>
31 {{ $diff := sub 5 $rating }} 32 {{ end }}
32 {{ range (seq $diff) }} 33 <h6>Rating:
33 34 {{ if isset .Params "rating" }}
34 {{ end }} 35 {{ $rating := .Params.rating }}
35 {{ else }} 36 {{ range (seq $rating) }}
36 <p>N/A</p> 37
37 {{ end }} 38 {{ end }}
38 </div> 39 {{ $diff := sub 5 $rating }}
39 {{ if isset .Params "amazon" }} 40 {{ range (seq $diff) }}
40 <p> 41
41 <a href="{{ .Params.amazon }}" target="_blank">amazon</a> 42 {{ end }}
42 </p> 43 {{ else }}
43 {{ end }} 44 N/A
44 <div> 45 {{ end }}
46 </h6>
47 {{ if isset .Params "amazon" }}
48 <h6>Links:
49 <a href="{{ .Params.amazon }}" target="_blank">Amazon</a>
50 </h6>
51 {{ end }}
52 </hgroup>
45 {{- .Content -}} 53 {{- .Content -}}
46 </div> 54 </div>
55</div>
47{{ end }} \ No newline at end of file 56{{ 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 @@
1<section class="flex row gap-1"> 1<section class="flex row gap-1">
2 {{ with resources.GetRemote .Params.image }} 2 {{ if isset .Params "image" }}
3 {{ with .Err }} 3 {{ with resources.GetRemote .Params.image }}
4 {{ errorf "%s" . }} 4 {{ with .Err }}
5 {{ errorf "%s" . }}
6 {{ else }}
7 {{ $image := . }}
8 {{ $image := $image.Resize "150x" }}
9 <img
10 src="{{ $image.RelPermalink }}"
11 width="{{ $image.Width }}"
12 height="{{ $image.Height }}"
13 alt="Book cover of the book {{ .Title }}"
14 style="border: solid 1px #8d8d8d;"
15 />
16 {{ end }}
5 {{ else }} 17 {{ else }}
6 {{ $image := . }} 18 {{ errorf "unable to get remote resource %q" .Params.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 }} 19 {{ end }}
15 {{ else }} 20 {{ else }}
16 {{ errorf "unable to get remote resource %q" .Params.image }} 21 <div
22 style="background: grey; border: solid 1px #8d8d8d; width: 150px; height: 225px;"
23 ></div>
17 {{ end }} 24 {{ end }}
18 <hgroup> 25 <hgroup>
19 <h3 class="f3 near-black"> 26 <h3 class="f3 near-black">
@@ -27,7 +34,10 @@
27 </h3> 34 </h3>
28 <p>Rating: {{ .Params.rating }} / 5</p> 35 <p>Rating: {{ .Params.rating }} / 5</p>
29 {{ with .Params.last_read }} 36 {{ with .Params.last_read }}
30 <p>Last Read: {{ . | time.Format ":date_full" }}</p> 37 {{ $last := index (.) 0 }}
38 {{/* if last_read is an array get the first item */}}
39
40 <p>Last Read: {{ $last | time.Format ":date_full" }}</p>
31 {{ end }} 41 {{ end }}
32 </hgroup> 42 </hgroup>
33</section> 43</section>