Drift Static (SSG) Meta-Framework
Drift Static (driftjs-ssg) is the official static site generation meta-framework for DriftJS. It combines the speed of pre-rendered static HTML with selective client-side hydration via Islands Architecture.
Core Principles
- Zero-JS by Default: Pages authored in
.driftand.mdare pre-rendered into pure semantic HTML with zero client JavaScript overhead. - Selective Islands Hydration: Add interactivity only where needed using client directives (
client:load,client:idle,client:visible,client:interaction,client:media). - File-System Routing: Structure your URLs naturally using directories,
.driftcomponents, and Markdown files insrc/pages/. - Hierarchical Nested Layouts: Compose layouts (
_layout.drift) hierarchically from root to subdirectories. - Content Collections: First-class Markdown content management with YAML frontmatter and table of contents generation.
- Automatic SEO: Automated
sitemap.xml,robots.txt, and canonical head tag generation.
Topics in this Section
- Framework Overview: The build pipeline, static rendering, and Vite integration.
- Islands Architecture: Deep dive into partial hydration and hydration trigger strategies.
- Routing & Layouts: File-system router, nested layouts, dynamic routes
[slug], andgetStaticPaths. - Content Collections: Markdown engine, frontmatter schemas,
getCollection, andgetEntry. - Configuration Guide: Complete reference for
drift.config.js.