diff options
| author | Zach Berwaldt <17715430+zberwaldt@users.noreply.github.com> | 2023-10-20 22:58:33 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-20 22:58:33 -0400 |
| commit | c516745d0dc2c6a51777ef00ef116c1b26e95ec7 (patch) | |
| tree | adcce31c689d3e63ab3ea8bd36f9ac384eca4cad /layouts/book/single.html | |
| parent | b34e09f8fe1011963934dbf40dc92f0b258592ca (diff) | |
| parent | 6bfd84ae2c7aad006c3bc84cdce9aebf894cbe62 (diff) | |
Develop
Diffstat (limited to 'layouts/book/single.html')
| -rw-r--r-- | layouts/book/single.html | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/layouts/book/single.html b/layouts/book/single.html new file mode 100644 index 0000000..baedf32 --- /dev/null +++ b/layouts/book/single.html | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | {{ define "main" }} | ||
| 2 | <hgroup> | ||
| 3 | <h1>{{ .Title }}</h1> | ||
| 4 | <h6>{{ .Date | time.Format ":date_full" }}</h6> | ||
| 5 | </hgroup> | ||
| 6 | {{ if isset .Params "image" }} | ||
| 7 | {{ with resources.GetRemote .Params.image }} | ||
| 8 | {{ with .Err }} | ||
| 9 | {{ errorf "%s" . }} | ||
| 10 | {{ else }} | ||
| 11 | {{ $image := . }} | ||
| 12 | {{ $image := $image.Resize "250x" }} | ||
| 13 | <img | ||
| 14 | src="{{ $image.RelPermalink }}" | ||
| 15 | width="{{ $image.Width }}" | ||
| 16 | height="{{ $image.Height }}" | ||
| 17 | alt="Book cover of the book {{ .Title }}" | ||
| 18 | /> | ||
| 19 | {{ end }} | ||
| 20 | {{ else }} | ||
| 21 | {{ errorf "unable to get remote resource %q" .Params.image }} | ||
| 22 | {{ end }} | ||
| 23 | {{ end }} | ||
| 24 | {{ if isset .Params "amazon" }} | ||
| 25 | <p> | ||
| 26 | <a href="{{ .Params.amazon }}" target="_blank">amazon</a> | ||
| 27 | </p> | ||
| 28 | {{ end }} | ||
| 29 | <div> | ||
| 30 | <p>Rating: </p> | ||
| 31 | {{ if isset .Params "rating" }} | ||
| 32 | {{ $rating := .Params.rating }} | ||
| 33 | {{ range $i, $num := (seq $rating) }} | ||
| 34 | ⭐ | ||
| 35 | {{ end }} | ||
| 36 | {{ else }} | ||
| 37 | <p>N/A</p> | ||
| 38 | {{ end }} | ||
| 39 | </div> | ||
| 40 | {{ end }} \ No newline at end of file | ||
