Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions component-library/components/list/list.hugo.html
Original file line number Diff line number Diff line change
Expand Up @@ -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<p class="pt-%d">%s.</p>` $raw $padding.y (T "emptyList") }}
Expand Down
15 changes: 15 additions & 0 deletions exampleSite/content/components/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---
2 changes: 1 addition & 1 deletion exampleSite/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions exampleSite/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down