From a893137976acd9fe517a2181ae4e47eba716ac0b Mon Sep 17 00:00:00 2001 From: Greg Date: Sun, 25 May 2025 20:37:14 +0200 Subject: [PATCH] feat: add tabbed category filtering to list page with All view default --- content/books/the-midnight-library.md | 2 +- layouts/_default/list.html | 63 ++++++++++++++++++++++----- 2 files changed, 53 insertions(+), 12 deletions(-) diff --git a/content/books/the-midnight-library.md b/content/books/the-midnight-library.md index 86c58bb..93292fe 100644 --- a/content/books/the-midnight-library.md +++ b/content/books/the-midnight-library.md @@ -3,7 +3,7 @@ title: "The Three Body Problem" category: "Books" image: "/img/3body.jpg" rating: 5.0 -tags: ["sciencefiction", "fantasy", "bestseller"] +tags: ["sciencefiction", "bestseller"] description: "A novel about choices, regrets, and the infinite possibilities of life." link: url: "https://en.wikipedia.org/wiki/The_Three-Body_Problem_(novel)" diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 93fc6dd..f17208e 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -1,13 +1,54 @@ {{ define "main" }} -

{{ .Title }}

- {{ .Content }} - +
+ {{ $categories := slice "Books" "Movies" "TV Series" "Recipes" "YouTube" "Music" "Concerts" }} + {{ range $i, $cat := $categories }} +
{{ $cat }}
+ {{ end }} +
+
+ {{ range .Pages }} + {{ if .Params.category }} + {{ partial "card.html" . }} + {{ end }} + {{ end }} +
+ {{ end }}