{{ define "main" }}

{{ .Title }}

{{ .Date | time.Format ":date_full" }}
{{ if isset .Params "image" }} {{ with resources.GetRemote .Params.image }} {{ with .Err }} {{ errorf "%s" . }} {{ else }} {{ $image := . }} {{ $image := $image.Resize "250x" }} Book cover of the book {{ .Title }} {{ end }} {{ else }} {{ errorf "unable to get remote resource %q" .Params.image }} {{ end }} {{ end }}
Rating: {{ if isset .Params "rating" }} {{ $rating := .Params.rating }} {{ range (seq $rating) }} ⭐ {{ end }} {{ $diff := sub 5 $rating }} {{ range (seq $diff) }} ☆ {{ end }} {{ else }}

N/A

{{ end }}
{{ if isset .Params "amazon" }}

amazon

{{ end }}
{{- .Content -}}
{{ end }}