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
- Initialize: Create output directory structure
- Content Generation:
- Homepage (with pagination)
- Individual posts and pages
- Custom pages with template resolution
- Taxonomy pages (categories/tags)
- SEO Files:
- XML sitemap (
sitemap.xml
) - HTML sitemap (
sitemap.html
) - RSS feed (
rss.xml
) - Robots.txt (
robots.txt
)
- XML sitemap (
- Asset Copying:
- Active theme assets
- Media uploads (excluding metadata)
- 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