feat: add opt-in Sanity CMS integration with @sanity/client v7.x#14
Draft
Axel-Moreau with Copilot wants to merge 2 commits into
Draft
feat: add opt-in Sanity CMS integration with @sanity/client v7.x#14Axel-Moreau with Copilot wants to merge 2 commits into
Axel-Moreau with Copilot wants to merge 2 commits into
Conversation
Copilot created this pull request from a session on behalf of
Axel-Moreau
July 8, 2026 15:29
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No CMS was wired up — all content lived as hardcoded TypeScript files in
src/content/. This adds a fully opt-in Sanity integration: whenSANITY_PROJECT_IDis set, content is fetched from Sanity at build time; otherwise the static files are used unchanged.How it works
scripts/fetch-content.ts— pre-build script that runs GROQ queries against Sanity and writes TypeScript files tosrc/content/_generated/, mirroring the exact export signatures of the static filesvite.config.ts— adds a conditional alias:@/content/* → src/content/_generated/*whenSANITY_PROJECT_IDis set; zero component code changes needed.github/workflows/deploy.yml— adds a conditional "Fetch content from Sanity" step (skipped when the secret is absent)sanity/schemas.ts— complete Sanity Studio schema definitions for all content types (siteSettings,pageContent,agendaTrack,resource,sponsorshipConfig,sponsor) ready to drop into a Studio projectActivation
Add three repository secrets and push:
SANITY_PROJECT_IDSANITY_DATASETproductionSANITY_TOKENContent type mapping
siteSettings(singleton)site.ts+agendaIntrofieldpageContent(singleton)sections.tsagendaTrack(one per tab)agenda.tsresource(one per item)resources.tssponsorshipConfig+sponsorsponsors.ts