Skip to content

Collection basics: a folder's default layout, listing cards and listing views - #63

Merged
StfBauer merged 9 commits into
mainfrom
feat/collection-basics
Nov 15, 2026
Merged

StfBauer merged 9 commits into
mainfrom
feat/collection-basics

Conversation

@StfBauer

Copy link
Copy Markdown
Contributor

0.5.0 step 2.

A folder's default layout. childLayout: on a folder's index.md gives the pages under it a layout when they name none; the nearest folder wins, and a page's own layout: wins over it. A childLayout that names no layout fails the index.md and every page that takes it, each page is checked against the schema of the layout it ends up with, and every problem about a page's layout names where it came from. The workbench lists a layout's Pages in its Relationships tab, each with where its layout came from; /api/pages gives layoutFrom.

The listing card. x-pd-card (a new schema extension, not a placement one) names the component each page of a listing is shown as, on a layout's page.children or a view's entries. Every page in the listing is checked against the card's schema: a required field a page doesn't have fails the listing, naming the page and what to add. A card declares only fields of a listing's entry (Pattern Dump's shape, the base every card shares), and its sample data is checked against that shape.

Listing views. view: grid on a folder's index.md shows its listing through views/grid, a component in the skin's style guide; Pattern Dump has none of its own. The layout writes {{{page.listing}}}; the view gets entries and names its card, so each view's required fields are checked on their own. A missing or unknown view, and a view on a page with no listing, are problems.

Starter. pd init --storefront ships four plain views (list, grid, featured, compact) with their cards; the articles listing uses view: list.

Contracts: optional StorefrontPage.layoutFrom, optional RelationshipsAvailable.pages.

Gates green locally (Node 24): lint:css x4, lint, typecheck, test, verify:install, E2E 354 / 182 / 155 / 7. Golden: _pd/main.js only (the Pages group), recorded.

@StfBauer
StfBauer merged commit 77eefa0 into main Nov 15, 2026
9 checks passed
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.

1 participant