From 2064220c3f24de2f44c56ad674f974dfa599a8b2 Mon Sep 17 00:00:00 2001 From: Mark Dumay <61946753+markdumay@users.noreply.github.com> Date: Mon, 3 Aug 2026 09:58:19 +0200 Subject: [PATCH] fix(list): forward justify to filter controls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `justify` reached the section wrapper and the heading, but not the table. The section applies it to the column as a whole, so with a `width` set it centered the column and left its contents flush left — a centered heading above a left-aligned filter button group. Forward the argument to assets/table.html, which positions the filter row only. The table still spans the full width of its container. Merged in only when the author set it, rather than passed on every call. Hinode is a separate module that a site resolves independently — it does not import mod-blocks — and `justify` reached the table structure in hinode v3.18.0. An older copy rejects an unknown argument whatever its value, so an unconditional forward would break every list block for anyone updating mod-blocks alone. Guarding it means only the authors who set `justify` need the newer hinode. Bump exampleSite to hinode v3.18.0 and add a centered, filtered list fixture that renders `justify-content-center`. Co-Authored-By: Claude Opus 5 (1M context) --- component-library/components/list/list.hugo.html | 15 +++++++++++++++ exampleSite/content/components/list.md | 15 +++++++++++++++ exampleSite/go.mod | 2 +- exampleSite/go.sum | 2 ++ 4 files changed, 33 insertions(+), 1 deletion(-) diff --git a/component-library/components/list/list.hugo.html b/component-library/components/list/list.hugo.html index 40e7286..39f973a 100644 --- a/component-library/components/list/list.hugo.html +++ b/component-library/components/list/list.hugo.html @@ -149,6 +149,21 @@ {{ if $paginate }} {{ $tableArgs = merge $tableArgs (dict "pagination" $pagination) }} {{ end }} + + {{/* `justify` already reaches the section wrapper and the heading, but the section + applies it to the column as a whole - with a `width` set, that centers the column + and leaves its contents flush left. Forward it to the table as well, so the filter + controls line up with the heading above them rather than with the column's edge. + The table itself is unaffected; it spans the full width either way. + + Merged only when the author set it, rather than passed unconditionally. Hinode is + a separate module that a site resolves on its own, and `justify` reached the table + structure in hinode v3.18.0; an older copy rejects an unknown argument whatever its + value, which would break every list block rather than only the ones that ask to be + aligned. This way the newer hinode is required only by the authors who use it. */}} + {{ with .justify }} + {{ $tableArgs = merge $tableArgs (dict "justify" .) }} + {{ end }} {{ $raw = printf "%s%s" $raw (partial "assets/table.html" $tableArgs) }} {{ else }} {{ $raw = printf `%s

%s.

` $raw $padding.y (T "emptyList") }} diff --git a/exampleSite/content/components/list.md b/exampleSite/content/components/list.md index c8eb71c..db40356 100644 --- a/exampleSite/content/components/list.md +++ b/exampleSite/content/components/list.md @@ -14,4 +14,19 @@ content_blocks: reverse: true sort: date limit: 3 + + - _bookshop_name: list + heading: + preheading: Blog + title: A centered, filtered page list + align: center + hide_empty: false + input: + section: blog + filter: + - post 1 + - post 2 + filter_col: 0 + width: 8 + justify: center --- diff --git a/exampleSite/go.mod b/exampleSite/go.mod index cfe8d67..2302afb 100644 --- a/exampleSite/go.mod +++ b/exampleSite/go.mod @@ -6,7 +6,7 @@ require ( github.com/FortAwesome/Font-Awesome v0.0.0-20260715180930-14c65a3747d0 // indirect github.com/airbnb/lottie-web v5.13.0+incompatible // indirect github.com/cloudcannon/bookshop/hugo/v3 v3.19.0 // indirect - github.com/gethinode/hinode/v3 v3.16.3 // indirect + github.com/gethinode/hinode/v3 v3.18.0 // indirect github.com/gethinode/mod-blocks/v2 v2.3.5 // indirect github.com/gethinode/mod-bootstrap v1.5.0 // indirect github.com/gethinode/mod-csp v1.0.14 // indirect diff --git a/exampleSite/go.sum b/exampleSite/go.sum index ba11f9f..751f295 100644 --- a/exampleSite/go.sum +++ b/exampleSite/go.sum @@ -32,6 +32,8 @@ github.com/gethinode/hinode/v3 v3.12.3 h1:XZ7hlvU8jqoRiIfEWYooLHR8QNs2COh/bB5Gpo github.com/gethinode/hinode/v3 v3.12.3/go.mod h1:J8azJZgUIXDxbqSPl8goPtayK2VekiltaBY9PnfHXKM= github.com/gethinode/hinode/v3 v3.16.3 h1:Zy2rG8RppxLM7k7hnUC6Do2tWHlrxRCW7Q2QYHJ4EuI= github.com/gethinode/hinode/v3 v3.16.3/go.mod h1:PqmewfbVBnwMVs6C4ZAKxjt9pYTAsOz+YF9gznJKHsk= +github.com/gethinode/hinode/v3 v3.18.0 h1:9ITPE1I0JlyGKwirYiZM759kPYd5YRD+mFtvPOOhb0g= +github.com/gethinode/hinode/v3 v3.18.0/go.mod h1:PqmewfbVBnwMVs6C4ZAKxjt9pYTAsOz+YF9gznJKHsk= github.com/gethinode/mod-blocks/v2 v2.2.5 h1:8glKSX7OENSgbRAp+Bc1JL68Ix3DSWcHWh5dlsNrNsk= github.com/gethinode/mod-blocks/v2 v2.2.5/go.mod h1:1a4A2RrNSEoqgUjJoNPc2T+JtfPe0GvjHNrxjXauWCA= github.com/gethinode/mod-blocks/v2 v2.2.6 h1:gTrTTyUcFLjcjuqvr5Ex923F2E777vOzkbFJDzNaSz0=