Skip to content

Mark preview builds, and add a generic content-collection loader - #29

Open
danielnaab wants to merge 3 commits into
mainfrom
labs/content-collections
Open

danielnaab wants to merge 3 commits into
mainfrom
labs/content-collections

Conversation

@danielnaab

@danielnaab danielnaab commented Dec 5, 2026 •

Copy link
Copy Markdown
Member

Groundwork for trying out new kinds of Labs content on preview branches. Production looks exactly the same.

What changes

  • Preview builds are marked. Every page on a branch preview (labs.flexion.us/preview/<branch>/) now has a banner, "This is a preview of proposed changes, not the live site.", linking to the live site, and noindex, nofollow so search engines don't index drafts. Production has neither.
  • A generic content-collection loader (src/build/collections.ts). It reads content/<name>/<slug>.md with YAML front-matter, validates fields with errors that name the file and the field, and fails the build on references to items that don't exist. A new page type then needs only a small schema and a template. Nothing on main uses it yet; preview branches will.

Checks

  • bun test (unit, views, build): 95 pass, including new loader and layout tests
  • a11y scan on the production build: passes
  • A preview build (SITE_BASE_URL=/preview/x/) carries the banner and noindex

Docs: docs/content-collections.md (new), and a section in docs/deployment.md on how previews are marked. The design-system page shows the new preview banner.

Preview builds (any base path other than /) now carry noindex and a
'Preview, not final' banner. src/build/collections.ts loads and validates
content/<name>/*.md with front-matter, and checks references between
items, so new page types need only a schema and a template.

Pot-Run: b872
@danielnaab
danielnaab temporarily deployed to preview/labs-content-collections December 5, 2026 04:03 — with GitHub Actions Inactive
@danielnaab
danielnaab temporarily deployed to preview/labs-content-collections December 5, 2026 04:11 — with GitHub Actions Inactive

This branch was successfully deployed

1 active deployment
preview/labs-content-collections — 9dc8f274 Deployed Dec 5, 2026 by danielnaab via publish #178
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