Hub Consolidation Over Per-Site Scaffolding

When building a platform that serves N variants of the same structure, start with a single consolidated site that treats variation as data, not as separate projects. Late consolidation — after scaffolding N separate sites — is expensive and produces a massive, risky changeset.

Tags

Hub Consolidation Over Per-Site Scaffolding

The Lesson

When building a platform that serves N variants of the same structure, start with a single consolidated site that treats variation as data, not as separate projects. Late consolidation — after scaffolding N separate sites — is expensive and produces a massive, risky changeset.

Context

A regulatory compliance readiness platform needed to serve 12 regulation topics (CCPA, GDPR, HIPAA, SOC 2, etc.), each with 9 identical page types (landing, what-is, readiness-process, about, controls, advisory, services, tools, 404). The initial approach scaffolded each regulation as its own Astro project with its own config, components, content, and deploy workflow. The hub site existed separately as a portal linking to these 12 sites.

What Happened

  1. Phase 010 built SOC 2 as the first standalone topic site across 5 sub-phases (scaffold, content collections, components, pages, hub integration). This produced a working reference implementation.
  2. Phase 011 replicated the SOC 2 content collection structure across the remaining 11 regulation topics — 11 separate content directories with the same 4 schemas.
  3. Phase 012 scaffolded all 11 regulation sites as independent Astro projects, each with their own astro.config.mjs, components, pages, and deploy workflows.
  4. After seeing the result — 12 near-identical projects with duplicated components, styles, and build configs — the decision was made to consolidate everything into the existing hub site.
  5. The consolidation commit touched 840 files, deleted ~99,000 lines of duplicated code, and moved all content into a single Astro project with shared components and content collections keyed by topic slug.
  6. Post-consolidation, several fixes were needed: MDX scoped styles didn't work (moved to global CSS), deploy workflow was in the wrong directory, relative links broke across topic pages, and nav branding needed topic-awareness.

Key Insights

Applicability

This applies to any platform serving multiple instances of the same structure: multi-tenant SaaS marketing sites, documentation sites for multiple products, or compliance portals for multiple frameworks. It does NOT apply when the variants genuinely diverge in structure — if topic A needs 9 pages and topic B needs 3, separate projects may be warranted.

Related Lessons

Related Lessons