Skip to content

docs: add custom $site fields - #80

Merged
lukeed merged 2 commits into
mainfrom
docs/site-fields
Oct 23, 2026
Merged

lukeed merged 2 commits into
mainfrom
docs/site-fields

Conversation

@lukeed

@lukeed lukeed commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Users can add their own fields to $site, but satisfies Config reports each one as an error. The types already allow it: Template.Site is an interface, so a config can add fields to it with declare module 'bongo'. This PR documents how.

Changes

  • config.md: a new section, "Your own $site fields", with an example.
  • typescript.md: a Template.Site row in the table of exported types.

Not changed

  • No types change. An index signature would remove typo checks, and a generic define<S>() would not give the fields to data modules, hooks, or plugins.

Test plan

  • bun test, bunx tsc -p ., bunx tsc -p build, bun run build
  • With the example augmentation, tsc accepts icon in $site and types Build.Data['$site'].icon
  • The section renders in bongo dev, and /config/#your-own-site-fields resolves

Comment thread docs/content/config.md Resolved
Comment thread docs/content/typescript.md Resolved
@lukeed lukeed changed the title docs: add own $site fields docs: add custom $site fields Oct 23, 2026
@lukeed
lukeed merged commit 7f7c755 into main Oct 23, 2026
4 checks passed
@lukeed
lukeed deleted the docs/site-fields branch October 23, 2026 00:16
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