Static Site Generation

On this page

StaticSiteGenerator (core/utils/static-generator.js): Converts the dynamic site to static HTML

Generator Architecture

Static Site Generator
├── Homepage Generation  # Index pages with pagination
├── Post Generation      # Individual post pages
├── Page Generation      # Static and custom pages
├── Taxonomy Generation  # Category and tag pages
├── SEO Generation       # Sitemap, RSS, robots.txt
└── Asset Copying        # Themes and uploads

Generation Process

  1. Initialize: Create output directory structure
  2. Content Generation:
    • Homepage (with pagination)
    • Individual posts and pages
    • Custom pages with template resolution
    • Taxonomy pages (categories/tags)
  3. SEO Files:
    • XML sitemap (sitemap.xml)
    • HTML sitemap (sitemap.html)
    • RSS feed (rss.xml)
    • Robots.txt (robots.txt)
  4. Asset Copying:
    • Active theme assets
    • Media uploads (excluding metadata)
  5. Cleanup: Remove metadata files

Configuration Options

{
  outputDir: "_site",           // Output directory
  baseUrl: "https://site.com",  // Base URL for links
  cleanUrls: true,              // Use directory/index.html
}

Performance Optimizations

  • Parallel Processing: Concurrent file operations
  • Incremental Updates: Only regenerate changed content
  • Asset Deduplication: Copy only active theme assets
  • Memory Management: Stream processing for large files