From e3e8fc2d67770f9feda6527a21497cf40af40293 Mon Sep 17 00:00:00 2001 From: Hunter Kvalevog Date: Sat, 29 Aug 2026 21:16:01 -0500 Subject: --- layouts/_shortcodes/movie.html | 27 +++++++++++++++++++++++++++ layouts/_shortcodes/movies.html | 10 ++++++++++ 2 files changed, 37 insertions(+) create mode 100644 layouts/_shortcodes/movie.html create mode 100644 layouts/_shortcodes/movies.html (limited to 'layouts') diff --git a/layouts/_shortcodes/movie.html b/layouts/_shortcodes/movie.html new file mode 100644 index 0000000..58ac53b --- /dev/null +++ b/layouts/_shortcodes/movie.html @@ -0,0 +1,27 @@ +{{- $review := trim .Inner "\n\r\t " -}} +{{- $rating := "" -}} +{{- with .Get "rating" -}} + {{- $r := float . -}} + {{- $pct := div (mul (math.Min (math.Max $r 0) 5) 100.0) 5 -}} + {{- $rating = printf `` $r $r $pct | safeHTML -}} +{{- end -}} +{{- if $review -}} +
+ + ▸ + {{ .Get "title" }} + {{ .Get "director" }} + {{ .Get "released" }} + {{ $rating }} + +
{{ $review | markdownify }}
+
+{{- else -}} +
+ + {{ .Get "title" }} + {{ .Get "director" }} + {{ .Get "released" }} + {{ $rating }} +
+{{- end -}} diff --git a/layouts/_shortcodes/movies.html b/layouts/_shortcodes/movies.html new file mode 100644 index 0000000..51d95f7 --- /dev/null +++ b/layouts/_shortcodes/movies.html @@ -0,0 +1,10 @@ +
+
+ + Title + Director(s) + Released + Rating +
+ {{ .Inner }} +
-- cgit v1.2.3