diff options
Diffstat (limited to 'layouts/book/single.html')
-rw-r--r-- | layouts/book/single.html | 59 |
1 files changed, 34 insertions, 25 deletions
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 |