Context
The klink.ing website is statically built on Netlify. Once Sanity CMS is integrated (issues 01–03 in the sanity-blog-and-projects feature), content changes in Sanity (blog posts, projects) won't appear on the live site until Netlify rebuilds. This issue tracks the manual dashboard configuration needed to connect the two.
PRD: .sandcastle/specs/sanity-blog-and-projects.md § 6 — Netlify Rebuild on Sanity Changes
Prerequisites
- Issues
sanity-blog-and-projects/01-sanity-studio, 02-sanity-integration-blog-projects, and 03-hamburger-menu are merged and deployed
- You have admin access to the Netlify site dashboard
- You have admin access to the Sanity project dashboard (manage.sanity.io)
Step 1: Create a Netlify Build Hook
- Go to the Netlify dashboard and select the klink.ing site
- Navigate to Site configuration → Build & deploy → Build hooks
- Click Add build hook
- Name it
sanity-cms (or similar — this is just a label)
- Select the main branch (or whichever branch Netlify deploys from)
- Click Save
- Copy the generated URL — it will look like:
https://api.netlify.com/build_hooks/XXXXXXXXXXXXXXXX
⚠️ Treat this URL as a secret. Anyone with it can trigger builds on your site.
Step 2: Create a Sanity Webhook
- Go to manage.sanity.io and select your project
- Navigate to API → Webhooks
- Click Create webhook and fill in:
- Name:
Netlify rebuild
- URL: Paste the Netlify build hook URL from Step 1
- Dataset:
production (or whichever dataset the website reads from)
- Trigger on: Select Create, Update, and Delete
- Filter:
_type in ["post", "project"]
- This limits rebuilds to content changes only — schema or config edits won't trigger unnecessary builds
- Projection: Leave empty (Netlify ignores the POST body)
- Status: Enabled
- HTTP method: POST
- HTTP Headers: None needed
- Secret: Leave empty (Netlify build hooks don't validate secrets)
- Click Save
Step 3: Verify the Integration
- In Sanity Studio, create or edit a blog post or project and click Publish
- Within a few seconds, check the Netlify dashboard — a new deploy should appear in the Deploys tab with the source shown as "Build hook: sanity-cms"
- Wait for the build to complete and verify the content change appears on the live site
Troubleshooting
- Build not triggering: Check the Sanity webhook logs at manage.sanity.io → API → Webhooks → click the webhook → Activity log. Look for failed deliveries or HTTP errors.
- Build triggers but content is stale: Make sure the Astro build is reading from the correct Sanity dataset and that
useCdn is set appropriately (CDN may have a short cache delay).
- Too many builds: If you're making many rapid edits, consider adding a short delay or batching publishes. Netlify automatically deduplicates overlapping builds.
Acceptance Criteria
Context
The klink.ing website is statically built on Netlify. Once Sanity CMS is integrated (issues 01–03 in the
sanity-blog-and-projectsfeature), content changes in Sanity (blog posts, projects) won't appear on the live site until Netlify rebuilds. This issue tracks the manual dashboard configuration needed to connect the two.PRD:
.sandcastle/specs/sanity-blog-and-projects.md§ 6 — Netlify Rebuild on Sanity ChangesPrerequisites
sanity-blog-and-projects/01-sanity-studio,02-sanity-integration-blog-projects, and03-hamburger-menuare merged and deployedStep 1: Create a Netlify Build Hook
sanity-cms(or similar — this is just a label)Step 2: Create a Sanity Webhook
Netlify rebuildproduction(or whichever dataset the website reads from)_type in ["post", "project"]Step 3: Verify the Integration
Troubleshooting
useCdnis set appropriately (CDN may have a short cache delay).Acceptance Criteria
postandprojectpublish/unpublish