Overview
Blog and content sites have unique architectural needs focused on content management, static generation, and SEO optimization. This example shows how to structure a content-heavy application following the Scope Rule.Project Structure
- Astro
- Next.js
- Angular
Astro is the ideal framework for content sites with its islands architecture and content collections.
Key Architectural Decisions
Newsletter Component
Usage: Blog sidebar, Footer, About page (3 locations) Decision: Shared component Reasoning: Used across multiple features (blog, marketing, about). Perfect candidate for shared components.Comment Form
Usage: Blog posts only Decision: Local to blog feature Reasoning: Specific to blog functionality. Even though every blog post uses it, it’s still within a single feature.Search Box
Usage: Blog listing, Documentation (2 locations) Decision: Shared component Reasoning: Crosses feature boundaries. Used in both blog and docs sections.Social Share Buttons
Usage: Blog posts, Author pages (2 locations within blog feature) Decision: Shared within blog feature Reasoning: Used by multiple pages within the same feature group, so it goes in the blog’s shared components.Content Collections Pattern (Astro)
Astro’s content collections provide type-safe content management:Performance Optimization
Static Generation
Pre-render all blog posts and documentation at build time for instant page loads.
Minimal JavaScript
Use static components by default. Only hydrate interactive elements like comments and search.
Content Collections
Type-safe content with automatic validation and optimized queries.
Image Optimization
Automatic image optimization with proper sizing and lazy loading.
SEO Best Practices
Meta Component
Create a reusable SEO component (this is shared because it’s used by all pages):Islands Architecture
For content sites, most components should be static. Use client islands only for:- Comment sections - User interaction required
- Search functionality - Real-time filtering
- Newsletter forms - Form validation and submission
- Theme toggles - Client-side preference storage
- Social sharing - External API interactions
Migration from WordPress or CMS
If migrating from a traditional CMS:- Export content - Convert posts to Markdown/MDX files
- Structure by feature - Organize by content type (blog, docs, pages)
- Identify shared components - Headers, footers, CTAs used everywhere
- Keep content local - Blog-specific components stay with blog
- Optimize for static - Pre-render everything possible
- Add interactivity - Use islands for forms, comments, search
