Personal portfolio of Pulkit Saraf (@PsudoKit).
npm run devContent — blog posts and OSS contributions — is managed via Sanity. The static data in src/data/ is the permanent baseline; Sanity adds new entries on top. Both sources are merged at request time.
- Fill in
.env.local(copy from.env.example, add your project ID + tokens). npm run dev— then visit http://localhost:3000/studio.- Log in with GitHub (must be added as a member of the Sanity project at sanity.io/manage).
- Open Studio (
/studiolocally or the deployed URL). - Click Blog Post → Create.
- Fill in: Title → hit "Generate" on Slug → Published At → Excerpt (≤200 chars) → Body.
- Mark Featured if it should appear on the homepage.
- Publish. The page auto-revalidates within 60 s (or immediately via the webhook).
- Studio → OSS Contribution → Create.
- Fill in: Title, Repo (
owner/name), Repo URL, PR URL, Status, Category. - Set Merged At for correct ordering.
- Publish.
Hit the revalidate endpoint directly:
curl -X POST https://psudokit.in/api/revalidate \
-H "sanity-webhook-signature: <sig>" \
-H "Content-Type: application/json" \
-d '{"_type":"blog","slug":{"current":"your-slug"}}'Or just wait — pages revalidate automatically every 60 s.
- Go to sanity.io/manage → your project → API → Webhooks → Create.
- URL:
https://psudokit.in/api/revalidate - Dataset:
production - Trigger on: Create, Update, Delete
- Filter (optional):
_type in ["blog", "ossContribution"] - HTTP method: POST
- Secret: paste the value of
SANITY_REVALIDATE_SECRETfrom your.env.local - Save and enable.
| Export | File | Powers |
|---|---|---|
allBlogsQuery |
src/sanity/queries.ts |
/blogs index |
blogBySlugQuery |
src/sanity/queries.ts |
/blogs/[id] detail |
featuredBlogsQuery |
src/sanity/queries.ts |
Homepage featured blogs |
allOssContributionsQuery |
src/sanity/queries.ts |
/opensource page |
featuredOssQuery |
src/sanity/queries.ts |
Homepage featured OSS |
ossByRepoQuery |
src/sanity/queries.ts |
Repo-grouped OSS view |
You can test any of these in Sanity Studio's Vision tab.
| Var | Where to get it |
|---|---|
NEXT_PUBLIC_SANITY_PROJECT_ID |
sanity.io/manage → project settings |
NEXT_PUBLIC_SANITY_DATASET |
Always production |
NEXT_PUBLIC_SANITY_API_VERSION |
Keep at 2025-01-01 |
SANITY_API_READ_TOKEN |
Manage → API → Tokens → Add (Viewer role) |
SANITY_REVALIDATE_SECRET |
openssl rand -hex 32 |