Add Sanity CMS integration for blog content management #9
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.
Summary
This PR integrates Sanity.io as a headless CMS for managing blog content on the Good Robot Co. website. The implementation enables dynamic blog post creation and management while maintaining the static site architecture through Next.js static site generation.
Key Features
/blog/[slug]) with static generation at build timeTechnical Changes
blogPostdocument type with rich content supportRichTextcomponent for Portable Text renderinggenerateStaticParamsfor SSGConfiguration
.env.local.examplefile for local developmenttests/config.jsto include new blog routesSANITY_SETUP.mdfor CMS configurationTesting
Test Plan
Prerequisites:
SANITY_PROJECT_ID)SANITY_DATASETvariable (defaults to 'production')Local Testing:
.env.local.exampleto.env.localand add Sanity credentialsnpm installto install new dependenciesnpm run devand verify:/blog/blog/[slug]npm run test:smoke- All smoke tests passnpm run test:sanity- Sanity integration tests passnpm run build- Build completes successfullynpm run test:build- Build validation passesout/blog/contains generated HTML filesCI/CD Testing:
Sanity Studio Testing:
npm run sanity:devto launch Sanity Studio locallyDeployment Testing:
Documentation:
SANITY_SETUP.mdfor detailed CMS configuration instructionsPLAYBOOK.mdfor development workflow and best practices🤖 Generated with Claude Code