-
Notifications
You must be signed in to change notification settings - Fork 0
feat: integrate Sanity CMS as primary content source #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- add .cursorrules with coding standards and guidelines - configure eslint exception for env.d.ts - enforce english-only code policy
- add sanity cms integration with studio at /admin route - create centralized config in src/lib/sanity.config.ts - add sanity client and api queries - create blogPost schema matching markdown structure - implement environment variable management - add sanity dependencies and types
- create getAllPosts utility to combine markdown and sanity posts - update all pages to use unified post collection - add sanity post detection and rendering in PostDetails - convert portable text to html for sanity posts - maintain consistent post structure across sources
- add detailed step-by-step guide for creating posts - document all post fields with descriptions - include troubleshooting section - add best practices and tips
- add 17 useful commands for development workflow - include composite workflows (start, check, fix, prod) - provide shorter alternatives to pnpm commands - add cleanup and maintenance commands
- add content management section - document justfile commands - link to cms documentation - update command reference
- add detailed conventional commit guidelines - define commit types and rules - add examples of good and bad commits - specify no claude signatures policy
- update env var naming convention in cursorrules - rename all sanity env vars with TORUS_BLOG_ prefix - update .env.example with new variable names - update sanity.config.ts to use prefixed variables
- remove path reference to .astro/types.d.ts (auto-imported) - keep only types references which are valid - remove eslint triple-slash-reference exception - resolve linting issue properly instead of disabling rule
- add build args to dockerfile for sanity env vars - configure github actions ci with environment secrets - create comprehensive deployment guide - document setup for docker, vercel, netlify, cloudflare, railway - add troubleshooting section for common deployment issues
- replace deprecated deskTool with structureTool in sanity config - add proper type for vite plugins in astro config - fix content component type in postdetails layout - remove unused ts-expect-error directive - ensure htmlcontent handles undefined with fallback
…ginx - Replace Nginx static file serving with Node.js server runtime - Switch Docker runtime base image from nginx:mainline-alpine-slim to node:lts-alpine - Update Dockerfile to copy dist and node_modules, expose port 3000, and run entry.mjs - Add Astro server configuration to bind to 0.0.0.0:4321 for Docker port exposure - Tested and verified application responds correctly on http://localhost:3000
Update dependencies to use @astrojs/vercel for Vercel deployments instead of @astrojs/node.
Remove unused hideEditPost prop that was referencing a deleted schema field.
Ensure only published posts (draft != true) are returned from Sanity in production. This prevents draft posts from appearing on the public site.
Use the 'published' perspective when creating the Sanity client to automatically exclude draft documents. This is the recommended approach according to Sanity's documentation and handles drafts at the API level rather than in queries.
…ion script - Convert markdown parsing pipeline to async to support inline image uploads - Update SanityImageBlock interface to use asset references instead of URLs - Make createImageBlock, processImage, processLine, parseMarkdownRecursive, and markdownToPortableText async - Pass SanityClient through parsing functions to enable image uploads - Add createImageBlock async function that uploads images and returns asset references - Handle missing/failed images gracefully with text placeholders - Enhance logging with upload progress indicators (📤 📊 ✅) - Add deleteAllPosts function to bulk delete posts from Sanity - Add delete-all command handler with batch processing (size: 10) - Update usage documentation with delete-all command This fixes the bug where inline images in markdown content were stored as local paths instead of Sanity asset references. Now images are properly uploaded during migration.
- Update SanityImageBlock to support both asset references and direct URLs - Add buildImageUrl function to construct public Sanity CDN URLs - Change uploadImageAsset to return public CDN URL instead of asset reference - Update createImageBlock to use url field with public CDN link - Enhance logging to display full CDN URL after upload This approach allows images to be displayed immediately using public CDN URLs instead of requiring asset reference resolution. The URL format matches: https://cdn.sanity.io/images/{projectId}/{dataset}/{assetId}
- Update SanityImageBlock to require asset reference structure
- Change uploadImageAsset to return assetId instead of URL
- Update createImageBlock to create asset references (image-assetId)
- Convert ogImage handling to use asset references
- Remove unused buildImageUrl function
The correct Sanity structure uses asset references:
{ _type: 'image', asset: { _type: 'reference', _ref: 'image-assetId' } }
Instead of direct URLs. This allows Sanity to properly track and manage
image assets, making them visible in the Studio UI and enabling features
like alt text, captions, and hotspot editing.
- Remove markdown post collection loading from getAllPosts() - Remove getCollection import and usage (no longer needed) - Remove markdown rendering logic from PostDetails.astro - Remove render import from PostDetails.astro - Simplify post content rendering to only use Sanity HTML - Remove getPath import (not needed for Sanity-only posts) - Disable dynamic OG image generation for Sanity posts All blog posts are now exclusively sourced from Sanity CMS. Markdown files in src/data/blog/ are no longer loaded or processed.
The scripts/migrate.ts file imports dotenv but it was not declared as a dependency, causing the build to fail during astro check. Added dotenv as a dev dependency to resolve the TypeScript error.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Main branch removed markdown posts in favor of Sanity CMS-only content. Deleted conflicting understanding-torus.md and associated images. All blog content should now be managed exclusively through Sanity CMS.
Deploying torus-blog with
|
| Latest commit: |
20cca2c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://46fe54cb.torus-blog.pages.dev |
| Branch Preview URL: | https://dev.torus-blog.pages.dev |
- Remove unused 'publicUrl' variable assignment - Remove unused 'i' parameter from forEach callback This fixes ESLint errors preventing CI from passing.
The function was defined but never called, causing lint errors.
Summary
Key Changes
Content Management:
Infrastructure:
Dependencies:
Documentation:
Test Plan