From 71e48e43cefa0b2830b8f167f5ca5d0a6dad738e Mon Sep 17 00:00:00 2001 From: mms Date: Mon, 11 Nov 2024 21:33:47 +0100 Subject: feat: book reviews --- layouts/partials/reviews/.#metrics.html | 1 + layouts/partials/reviews/metrics.html | 28 ++++++++++++++++++++++++ layouts/partials/reviews/related.html | 23 ++++++++++++++++++++ layouts/reviews/list.html | 38 +++++++++++++++++++++++++++++++++ layouts/reviews/single.html | 22 +++++++++++++++++++ layouts/shortcodes/.#review-table.html | 1 + layouts/shortcodes/review-table.html | 30 ++++++++++++++++++++++++++ 7 files changed, 143 insertions(+) create mode 120000 layouts/partials/reviews/.#metrics.html create mode 100644 layouts/partials/reviews/metrics.html create mode 100644 layouts/partials/reviews/related.html create mode 100644 layouts/reviews/list.html create mode 100644 layouts/reviews/single.html create mode 120000 layouts/shortcodes/.#review-table.html create mode 100644 layouts/shortcodes/review-table.html (limited to 'layouts') diff --git a/layouts/partials/reviews/.#metrics.html b/layouts/partials/reviews/.#metrics.html new file mode 120000 index 0000000..8a2a5d0 --- /dev/null +++ b/layouts/partials/reviews/.#metrics.html @@ -0,0 +1 @@ +mms@voyager.local.23203:1731088680 \ No newline at end of file diff --git a/layouts/partials/reviews/metrics.html b/layouts/partials/reviews/metrics.html new file mode 100644 index 0000000..08c9c9a --- /dev/null +++ b/layouts/partials/reviews/metrics.html @@ -0,0 +1,28 @@ +
+ {{- $path := .Params.image }} + {{- $img := resources.Get $path }} + {{- $img1x := $img.Resize "170x webp" }} + {{- $img2x := $img.Resize "340x webp" }} + + Cover +
+ +
+{{ $rating := .Params.rating}} + My rating:
+ + {{- range $i, $sequence := (seq 15) }} + {{- if le (mul $sequence 25) (mul (sub $rating 1) 100)}}◾{{- else}}◽{{- end }} + {{- end }} +
+ {{ $rating }}/5 +
diff --git a/layouts/partials/reviews/related.html b/layouts/partials/reviews/related.html new file mode 100644 index 0000000..6432331 --- /dev/null +++ b/layouts/partials/reviews/related.html @@ -0,0 +1,23 @@ +{{ $page := .}} +{{ $reviews := where .Site.RegularPages "Section" "eq" "reviews" }} + diff --git a/layouts/reviews/list.html b/layouts/reviews/list.html new file mode 100644 index 0000000..b5a9643 --- /dev/null +++ b/layouts/reviews/list.html @@ -0,0 +1,38 @@ +{{ define "main" }} +{{ $page := .Page }} +
+{{ .Content }} + +{{ range .Params.reviewSection}} +

{{ . }}

+ + + + + + + + + {{- range +(where $page.Site.RegularPages ".Params.reviewSection" "intersect" (slice .)).ByTitle }} + + + + + + {{- end }} + +
TitleRTG
{{ .Title }}{{ .Params.Rating}}
+ {{ end }} +
+ +{{ end }} diff --git a/layouts/reviews/single.html b/layouts/reviews/single.html new file mode 100644 index 0000000..8b8e1da --- /dev/null +++ b/layouts/reviews/single.html @@ -0,0 +1,22 @@ +{{ define "main" }} +
+ + +

{{ .Title }}

+
+ + {{ .Page.Content }} + +
+ +
+{{- end }} diff --git a/layouts/shortcodes/.#review-table.html b/layouts/shortcodes/.#review-table.html new file mode 120000 index 0000000..8a2a5d0 --- /dev/null +++ b/layouts/shortcodes/.#review-table.html @@ -0,0 +1 @@ +mms@voyager.local.23203:1731088680 \ No newline at end of file diff --git a/layouts/shortcodes/review-table.html b/layouts/shortcodes/review-table.html new file mode 100644 index 0000000..4460525 --- /dev/null +++ b/layouts/shortcodes/review-table.html @@ -0,0 +1,30 @@ + + + + + + + + + {{- range +(where .Site.RegularPages ".Section" "intersect" (slice .Section)).ByTitle }} + + + + + + {{- end }} + +
TitleRTG
{{ .Title }}{{ .Params.Rating}}
-- cgit v1.2.3