Skip to content

Conversation

@aleexwong
Copy link
Owner

Summary

This PR introduces a comprehensive SEO infrastructure for generating and managing 100,000+ programmatic pages at scale. It includes reusable page templates, schema generation utilities, and build optimization tools designed to maintain consistent SEO implementation across a massive page inventory.

Key Changes

New Components

  • SeoPageTemplate - Unified, composable template for all programmatic SEO pages with:

    • Automatic meta tag generation (title, description, OG, Twitter)
    • Structured data (JSON-LD) schema support
    • Breadcrumb navigation
    • FAQ sections with customizable styling
    • Cross-tool internal linking
    • Multiple gradient variants for different tools
    • Extensible architecture for custom content
  • RacePageTemplate - Specialized template extending SeoPageTemplate for race preparation pages with:

    • Course preview maps using Leaflet
    • Elevation statistics and visualization
    • Race-specific tips and fueling notes
    • Event schema support
    • Route data integration from marathon-data.json

Build Utilities (build-utils.ts)

  • Data Chunking - Split 100k+ pages into manageable chunks by tool/category to prevent memory issues
  • Sitemap Generation - Streaming XML sitemap generation with automatic splitting for Google's 50k URL limit
  • Route Generation - Batch processing for efficient prerendering
  • Build Cache - Content hashing and cache validation for incremental builds
  • Prerender Config - Adaptive concurrency settings based on page count
  • Build Stats - Analytics on page distribution, content metrics, and estimated build time

SEO Infrastructure

  • Integrated with existing @/lib/seo utilities for:
    • Meta tag generation
    • Schema graph generation
    • Breadcrumb generation
    • Internal linking strategies
  • Support for race event data and structured data markup
  • Configurable variants for different tool types (pace, fuel, elevation, race, blog)

Implementation Details

  • Memory Efficiency - Pages are chunked (default 5k per chunk) to handle large datasets without memory exhaustion
  • Sitemap Scaling - Automatically generates sitemap index when exceeding 50k URLs
  • Adaptive Prerendering - Concurrency and timeouts adjust based on total page count (3-20 concurrent builds)
  • Type Safety - Full TypeScript support with comprehensive interfaces
  • Composability - Templates accept custom content, sections, and styling for flexibility
  • SEO Best Practices - Automatic canonical URLs, proper schema markup, breadcrumbs, and internal linking

Files Added

  • src/components/seo/SeoPageTemplate.tsx (389 lines)
  • src/components/seo/RacePageTemplate.tsx (387 lines)
  • src/components/seo/index.ts (11 lines)
  • src/lib/seo/build-utils.ts (448 lines)

Files Modified

  • src/features/seo-pages/seoPages.ts - Updated with new page configurations

This major refactor introduces a comprehensive programmatic SEO system
designed to safely scale to 100,000+ pages while maintaining:

- Type-safe SEO data structures with full TypeScript support
- Centralized schema generators (JSON-LD) for all page types
- Dynamic meta tag generation (title, description, OG, Twitter)
- Hub-and-spoke internal linking architecture
- Content variation system to avoid duplicate/thin content
- Build utilities for chunked data loading and sitemap generation
- Quality validation and safeguards for SEO at scale

Key additions:
- src/lib/seo/types.ts - Complete type system for SEO data
- src/lib/seo/schema-generators.ts - JSON-LD schema generation
- src/lib/seo/meta-generators.ts - Meta tag utilities
- src/lib/seo/internal-linking.ts - Hub-spoke linking engine
- src/lib/seo/content-generators.ts - Content variation system
- src/lib/seo/build-utils.ts - Sitemap/chunk/cache utilities
- src/lib/seo/validation.ts - Quality assurance checks
- src/components/seo/SeoPageTemplate.tsx - Unified page template
- src/components/seo/RacePageTemplate.tsx - Race-specific template

Updated src/features/seo-pages/seoPages.ts to use new system with
proper page IDs and enhanced type safety.

https://claude.ai/code/session_01X6CmSazsmZNKDrNeh7eUkS
@vercel
Copy link

vercel bot commented Jan 23, 2026

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

Project Deployment Review Updated (UTC)
trainpace Error Error Jan 23, 2026 3:46pm

@netlify
Copy link

netlify bot commented Jan 23, 2026

Deploy Preview for trainpace failed. Why did it fail? →

Name Link
🔨 Latest commit 47873cc
🔍 Latest deploy log https://app.netlify.com/projects/trainpace/deploys/697397b5b32d6a000842f557

Documents the new scalable SEO system including:
- SEO module structure and key types
- Page templates (SeoPageTemplate, RacePageTemplate)
- How to add new SEO pages
- Content generation utilities
- Schema and meta tag generation
- Internal linking engine
- Validation and build utilities
- SEO best practices

https://claude.ai/code/session_01X6CmSazsmZNKDrNeh7eUkS
Sign up for free to 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.

3 participants