diff options
Diffstat (limited to 'layouts/book/single.html')
-rw-r--r-- | layouts/book/single.html | 61 |
1 files changed, 30 insertions, 31 deletions
diff --git a/layouts/book/single.html b/layouts/book/single.html index 0bbd265..66456e1 100644 --- a/layouts/book/single.html +++ b/layouts/book/single.html | |||
@@ -1,39 +1,38 @@ | |||
1 | {{ define "main" }} | 1 | {{ define "main" }} |
2 | <article> | 2 | <hgroup> |
3 | <h1>{{ .Title }}</h1> | 3 | <h1>{{ .Title }}</h1> |
4 | <h4>{{ .Params.author }}</h4> | ||
5 | <h6>{{ .Date | time.Format ":date_full" }}</h6> | 4 | <h6>{{ .Date | time.Format ":date_full" }}</h6> |
6 | {{ if isset .Params "image" }} | 5 | </hgroup> |
7 | {{ with resources.GetRemote .Params.image }} | 6 | {{ if isset .Params "image" }} |
8 | {{ with .Err }} | 7 | {{ with resources.GetRemote .Params.image }} |
9 | {{ errorf "%s" . }} | 8 | {{ with .Err }} |
10 | {{ else }} | 9 | {{ errorf "%s" . }} |
11 | <img | ||
12 | src="{{ .RelPermalink }}" | ||
13 | width="{{ .Width }}" | ||
14 | height="{{ .Height }}" | ||
15 | alt="Book cover of the book {{ .Title }}" | ||
16 | /> | ||
17 | {{ end }} | ||
18 | {{ else }} | 10 | {{ else }} |
19 | {{ errorf "unable to get remote resource %q" .Params.image }} | 11 | <img |
12 | src="{{ .RelPermalink }}" | ||
13 | width="{{ .Width }}" | ||
14 | height="{{ .Height }}" | ||
15 | alt="Book cover of the book {{ .Title }}" | ||
16 | /> | ||
20 | {{ end }} | 17 | {{ end }} |
18 | {{ else }} | ||
19 | {{ errorf "unable to get remote resource %q" .Params.image }} | ||
20 | {{ end }} | ||
21 | {{ end }} | ||
22 | {{ if isset .Params "amazon" }} | ||
23 | <p> | ||
24 | <a href="{{ .Params.amazon }}" target="_blank">amazon</a> | ||
25 | </p> | ||
26 | {{ end }} | ||
27 | <div> | ||
28 | <p>Rating: </p> | ||
29 | {{ if isset .Params "rating" }} | ||
30 | {{ $rating := .Params.rating }} | ||
31 | {{ range $i, $num := (seq $rating) }} | ||
32 | ⭐ | ||
21 | {{ end }} | 33 | {{ end }} |
22 | {{ if isset .Params "amazon" }} | 34 | {{ else }} |
23 | <p> | 35 | <p>N/A</p> |
24 | <a href="{{ .Params.amazon }}" target="_blank">amazon</a> | ||
25 | </p> | ||
26 | {{ end }} | 36 | {{ end }} |
27 | <div> | 37 | </div> |
28 | <p>Rating: </p> | ||
29 | {{ if isset .Params "rating" }} | ||
30 | {{ $rating := .Params.rating }} | ||
31 | {{ range $i, $num := (seq $rating) }} | ||
32 | ⭐ | ||
33 | {{ end }} | ||
34 | {{ else }} | ||
35 | <p>N/A</p> | ||
36 | {{ end }} | ||
37 | </div> | ||
38 | </article> | ||
39 | {{ end }} \ No newline at end of file | 38 | {{ end }} \ No newline at end of file |