name: dt-sanity-cms description: >- Publishes and edits Digitaltableteur blog content via Sanity CMS, regenerates blog manifest, and verifies blog routes. Use when the user says "Sanity", "publish blog", "sanity:publish", "blog post", "blog manifest", "schemaTypes", or edits digitaltableteur-blog/ or app/blog/. Do NOT use for generic Next.js pages outside blog (dt-nextjs-app) or component work (dt-design-system). metadata: version: 1.1.0 category: cms
Sanity CMS and blog workflow
Instructions
Step 1: Load context
Read references/area-guide.md and digitaltableteur-blog/AGENTS.md.
Schema types: digitaltableteur-blog/schemaTypes/
Step 2: Publish content
npm run sanity:dev # optional local studio preview
npm run sanity:publish # publish + refresh manifest
Alternative: scripts/publish-from-sanity.sh
Expected: updates to nextjs-app/shared/data/blogManifest.ts and/or app/blog/postMetadata.ts.
Step 3: After publish
- Inspect git diff for generated manifest files
- Commit generated changes if intentional
- Verify routes locally:
npm run dev
# /blog, /blog/[slug], /blog/authors/[slug]
Step 4: Schema changes
When editing schemaTypes/:
- Update app TypeScript types if referenced
npm run sanity:dev— confirm studio loads- Republish sample content to validate GROQ queries
CRITICAL: never hand-edit generated manifest files.
Examples
Example 1: New blog post live
User says: "I published an article in Sanity, make it show on the site"
Actions:
- Run
npm run sanity:publish - Commit manifest diff if changed
- Verify
/blog/[slug]renders with correct metadata and OG image
Example 2: Author page OG wrong
User says: "Author OG uses old logo"
Actions:
- Check
app/blog/authors/[slug]/foropengraph-image.tsx - Prefer profile photo; fallback to generated card
- Remove any hardcoded
logo512.pngfrom metadata
Troubleshooting
Build fails: missing post in manifest
Cause: manifest not regenerated after CMS publish.
Solution: npm run sanity:publish or node scripts/generate-blog-manifest.mjs
Studio won't start
Cause: missing Sanity env vars or wrong project ID.
Solution: ask user to verify .env.local Sanity credentials; do not commit them.
Slug 404 after publish
Cause: post not in manifest or visibility flag excludes it.
Solution: check getVisiblePosts() / manifest entry and post status in Sanity.
Boundaries
- MUST NOT hand-edit
blogManifest.tsorpostMetadata.ts - Ask before bulk delete or destructive CMS operations