Skip to content

feat(blogs): added blogs scaffolding - #1857

Merged
waleedlatif1 merged 1 commit into
stagingfrom
sim-24
Nov 8, 2025
Merged

feat(blogs): added blogs scaffolding#1857
waleedlatif1 merged 1 commit into
stagingfrom
sim-24

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • added blogs scaffolding with SEO, styling, authors, everything baked in
  • extendible and flexible

Type of Change

  • New feature

Testing

Tested manually.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercelBot commented Nov 8, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

ProjectDeploymentPreviewCommentsUpdated (UTC)
docsReadyReadyPreviewCommentNov 8, 2025 8:02am

@greptile-appsgreptile-appsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

This PR introduces a complete blog scaffolding system for the Sim platform, replacing hardcoded blog posts with a flexible MDX-based content management system. The implementation is production-ready and follows Next.js 15 best practices.

Key Changes

  • MDX-based blog system: Created a file-based blog architecture using next-mdx-remote with content stored in content/blog/{slug}/index.mdx
  • Dynamic routing: Implemented [slug] dynamic routes replacing hardcoded blog post pages
  • Author management: Added JSON-based author profiles with validation
  • SEO optimization: Comprehensive metadata generation with OpenGraph, Twitter cards, JSON-LD structured data, RSS feeds, and image sitemaps
  • Content validation: Zod schemas ensure frontmatter data integrity
  • Custom MDX components: Styled typography, images, and layout components for consistent blog rendering
  • Related posts: Tag-based algorithm to surface relevant content
  • Caching strategy: In-memory caching of parsed frontmatter and authors with proper revalidation
  • Legacy URL support: Redirects from /building/* to /blog/* for backward compatibility

Architecture Highlights

The system follows a clean separation of concerns:

  • lib/blog/registry.ts - Core content loading and caching logic
  • lib/blog/schema.ts - Type-safe data structures with Zod
  • lib/blog/seo.ts - Centralized SEO metadata builders
  • lib/blog/mdx.tsx - Custom MDX component overrides
  • Dynamic Next.js routes for posts, authors, tags, RSS, and sitemaps

The implementation is extensible, allowing easy addition of new blog posts by simply creating MDX files with proper frontmatter.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation is clean, well-structured, and follows Next.js and React best practices. Code uses proper type safety with TypeScript and Zod validation, implements appropriate caching strategies, includes comprehensive SEO features, and properly handles edge cases like missing authors or posts. No security vulnerabilities detected - JSON-LD is properly serialized, user input is sanitized through Zod schemas, and file system operations are scoped to content directories.
  • No files require special attention

Important Files Changed

File Analysis

FilenameScoreOverview
apps/sim/lib/blog/registry.ts5/5Added core blog post registry with MDX compilation, author loading, caching, and related posts logic
apps/sim/lib/blog/schema.ts5/5Defined Zod schemas for blog frontmatter validation with author, tags, FAQ, and metadata fields
apps/sim/lib/blog/seo.ts5/5Implemented comprehensive SEO metadata builders for posts with OpenGraph, Twitter cards, and JSON-LD
apps/sim/lib/blog/mdx.tsx5/5Created custom MDX components with styled headings, images, lists, and typography for blog rendering
apps/sim/app/(landing)/blog/page.tsx5/5Implemented blog index page with featured post, masonry grid layout, pagination, and tag filtering
apps/sim/app/(landing)/blog/[slug]/page.tsx5/5Created dynamic blog post page with metadata generation, related posts, and structured data markup
apps/sim/next.config.ts5/5Added redirects for legacy blog URLs and moved RSS/sitemap feeds to blog namespace

Sequence Diagram

sequenceDiagram
participant User
participant BlogIndex as /blog
participant BlogPost as /blog/[slug]
participant Registry as registry.ts
participant MDX as MDX Compiler
participant FileSystem as File System
participant SEO as seo.ts
User->>BlogIndex: Visit blog homepage
BlogIndex->>Registry: getAllPostMeta()
Registry->>FileSystem: Read content/blog/*/index.mdx
FileSystem-->>Registry: MDX frontmatter
Registry->>Registry: Parse with BlogFrontmatterSchema
Registry->>FileSystem: Load authors from content/authors/*.json
FileSystem-->>Registry: Author data
Registry-->>BlogIndex: BlogMeta[]
BlogIndex->>User: Render post grid with featured post
User->>BlogPost: Click post link
BlogPost->>Registry: getPostBySlug(slug)
Registry->>FileSystem: Read content/blog/{slug}/index.mdx
FileSystem-->>Registry: MDX content + frontmatter
Registry->>MDX: compileMDX(content, mdxComponents)
MDX->>MDX: Apply remark-gfm, rehype-slug, rehype-autolink-headings
MDX-->>Registry: Compiled React component
Registry->>Registry: Extract h2 headings for TOC
Registry-->>BlogPost: BlogPost with Content component
BlogPost->>SEO: buildPostMetadata(post)
SEO-->>BlogPost: Metadata with OpenGraph, Twitter cards
BlogPost->>SEO: buildArticleJsonLd(post)
SEO-->>BlogPost: JSON-LD structured data
BlogPost->>Registry: getRelatedPosts(slug, 3)
Registry->>Registry: Score posts by shared tags
Registry-->>BlogPost: Related posts
BlogPost->>User: Render post with metadata, content, related posts
Loading

24 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1
waleedlatif1 merged commit 945405c into stagingNov 8, 2025
9 checks passed
@waleedlatif1
waleedlatif1 deleted the sim-24 branch November 8, 2025 08:04
waleedlatif1 added a commit that referenced this pull request Nov 9, 2025
waleedlatif1 added a commit that referenced this pull request Nov 12, 2025
@waleedlatif1waleedlatif1 mentioned this pull request Nov 12, 2025
10 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@waleedlatif1