Skip to content

feat: group a section's card index the way its sidebar groups pages - #561

Merged
has2k1 merged 1 commit into
posit-dev:mainfrom
drbenvincent:feat/grouped-section-index
Nov 6, 2026
Merged

has2k1 merged 1 commit into
posit-dev:mainfrom
drbenvincent:feat/grouped-section-index

Conversation

@drbenvincent

Copy link
Copy Markdown
Contributor

The generated card index and the sidebar were two views of the same section, and they did not agree. The sidebar grouped pages by subdirectory. The index ignored those groups, put every page with an image in one grid, and dropped pages without an image into a list under a horizontal rule.

When a section has subdirectory groups, or sidebar_groups is set, the generated index now uses those same groups, titles, and order. Each group is a Markdown heading and one .section-cards grid. A page without an image stays in its group. Top-level pages stay in one grid before the first heading. Pages that sidebar_groups does not name stay after the groups, with no heading. A section with no groups keeps the flat image-then-plain layout. index_groups: false keeps that layout even when the sidebar has groups. A hand-written index.qmd is still used as-is.

The headings are Markdown, so a site that shows a table of contents will list them. The card markup is unchanged.

Fixes #553.

@has2k1

has2k1 commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

@drbenvincent, please rebase.

A generated index ignored parent directories and split cards by whether
a page had an image, so the gallery and the sidebar showed two different
arrangements of the same section. The index now uses the sidebar's groups,
titles, and order. Set index_groups: false to keep the flat grid.
@drbenvincent
drbenvincent force-pushed the feat/grouped-section-index branch from cb60dda to 488659a Compare November 5, 2026 19:30
@has2k1
has2k1 merged commit 93f5e4e into posit-dev:main Nov 6, 2026
16 of 23 checks passed
@has2k1

has2k1 commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

@drbenvincent, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Group a section's card index by the same sections as its sidebar

2 participants