Automated migration of Helm v2 documentation from the original source repository to Docusaurus versioned documentation format, preserving the familiar v2.helm.sh navigation structure and fixing broken links.
- Complete Structure Analysis - Analyzes live v2.helm.sh to capture exact sidebar structure
- Missing File Integration - Adds helm commands not present in navigation but available in source
- Link Path Correction - Fixes broken internal links using shared href processing utility
- Image Path Replacement - Updates all image references to
/img/helm2/format - H2 Heading Removal - Removes redundant first H2 headings from helm command files
- Index File Creation - Generates proper Docusaurus landing page with DocCardList
- Proper Positioning - Maintains v2.helm.sh hierarchical organization
- Fully idempotent - Safe to re-run multiple times
Simple command:
yarn migrate:v2Manual steps (if needed):
-
Run complete migration:
node scripts/migrate-v2-docs.js
-
Copy images (if not already present):
cp -r helm2/docs/images static/img/helm2
The migration command handles all steps automatically including:
- Cloning helm2 source repository
- Generating navigation structure
- Processing and copying files
- Applying link path corrections
The migration process includes:
- Fresh Start: Clears existing v2 documentation and helm2 source
- Source Setup: Clones Helm v2 repository (release-2.17 branch)
- Structure Analysis:
scripts/v2/menu-generate.jsfetches and analyzes complete v2.helm.sh sidebar structure - Content Processing:
scripts/v2/copy-files.jsprocesses all files:- Removes UTF-8 BOM characters
- Replaces image paths from
(images/to(/img/helm2/ - Removes first H2 headings from helm command files
- Creates proper Docusaurus frontmatter with hierarchical positioning
- Adds missing helm commands (helm get notes, helm inspect readme)
- Link Correction:
scripts/util/href-diffs-process.jsfixes broken internal links usingscripts/v2/href-diffs.json - Structure Creation: Generates
versioned_docs/version-2/with proper category organization - Index Generation: Creates
index.mdxlanding page with DocCardList component
versioned_docs/version-2/ # Complete Docusaurus v2 docs
├── index.mdx # Landing page (position 1)
├── using_helm/ # Basic usage (position 2)
├── helm/ # CLI reference (position 3, 45 commands)
├── developing_charts/ # Chart development (position 4)
├── chart_template_guide/ # Template guides (position 5)
├── chart_best_practices/ # Best practices (position 6)
└── [5 top-level files] # architecture, developers, etc. (positions 7-11)
static/img/helm2/ # All migrated images
Verify after running:
- Navigation matches v2.helm.sh structure with correct positioning (1,2,3,4,5,6,7-11)
- All images display correctly (
/img/helm2/paths) - Index files use parent category labels in sidebar
- First H2 headings removed from all helm command files
- Netlify redirects handle v2 → v3 category mapping
Key paths:
- Migration orchestrator:
scripts/migrate-v2-docs.js - Component scripts:
scripts/v2/menu-generate.js,scripts/v2/copy-files.js - Link correction:
scripts/util/href-diffs-process.jswithscripts/v2/href-diffs.json - Generated data:
scripts/v2/menu.json - Source:
helm2/docs/(auto-cloned) - Output:
versioned_docs/version-2/andstatic/img/helm2/
The migration is fully automated and idempotent - safe to re-run multiple times.
Link path corrections: Managed via scripts/v2/href-diffs.json - add entries here to fix additional broken links discovered in migrated content.