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=