Why products migrate to web-unified-docs
HashiCorp’s documentation was historically distributed across individual product repositories. Each repository maintained its own/website or /docs directory, and a GitHub App monitored for events to extract and publish content to developer.hashicorp.com via the existing content API (content.hashicorp.com).
This approach has several limitations:
Cross-version changes require many PRs
Cross-version changes require many PRs
Making the same change across multiple documentation versions requires multiple pull requests — one per version branch — in the product repository.
Cross-product changes are difficult
Cross-product changes are difficult
Platform-level changes such as updating to MDX v2 or rewriting URLs require coordinating changes across many separate repositories.
Event-driven publishing is fragile
Event-driven publishing is fragile
If a GitHub event is missed, documentation becomes stale. There is no simple way to republish without triggering a new event.
Docs can block product releases
Docs can block product releases
When documentation lives in product repositories, broken docs can interfere with the release workflow for the product itself.
Adding a new product requires code changes
Adding a new product requires code changes
Onboarding a new product to the content API requires code changes on the API side and installation of a GitHub App in the product repository.
hashicorp/web-unified-docs) solves these problems by centralizing all product documentation into a single repository and a single branch.
Single PR for all versions
All versioned docs live on the filesystem simultaneously. A find-and-replace can update content across every version in a single PR.
Simple onboarding
Adding a new product is as simple as creating a new folder in
content/ and adding an entry to productConfig.mjs.Reliable publishing
Publishing is driven by the repository itself, not external events. If something goes wrong, just run the process again.
Docs no longer block releases
Documentation changes are fully decoupled from product release workflows.
How the migration works
The migration process extracts versioned documentation from a product repository’s git history and copies it into thecontent/ directory of web-unified-docs. The existing content.hashicorp.com API is used to determine which git refs correspond to the versions currently live on developer.hashicorp.com.
For each version, the migration script:
- Clones the product repository into a temporary
.content-source-repos/directory - Checks out the git ref corresponding to that version
- Copies content files (
.mdx) intocontent/<product-slug>/<version>/ - Copies navigation data (
*-nav-data.json) into the same versioned directory - Converts and copies redirects from
redirects.jstoredirects.jsonc - Copies image assets into
content/<product-slug>/<version>/img/
After migration: web-unified-docs becomes the source of truth
Once a product’s documentation is migrated and the migration PR is merged into web-unified-docs, this repository becomes the authoritative source for that product’s documentation. To communicate this clearly to contributors, theupdate-mdx-files.sh script adds a prominent notice to all .mdx files in the original product repository’s /website directory. This notice appears at the top of each file in the source editor and directs contributors to make changes in web-unified-docs instead.
Temporary fallback
During the transition period, the original documentation may temporarily remain in the product repository as a fallback. The existing content API continues to serve content for products that have not yet completed migration, and dev-portal sources content from both APIs simultaneously. The architecture looks like this:- Non-migrated products: content flows from the product repo → existing content API → dev-portal
- Migrated products: content flows from web-unified-docs → unified docs API → dev-portal
/website directory in the product repo is kept for historical reference but is no longer the source for published documentation.
What happens to the original product repo docs
After migration:- The
update-mdx-files.shscript adds a deprecation notice to every.mdxfile in the original location - Contributors are directed to make future changes in web-unified-docs
- The original files remain in place but are no longer published
- The product repository’s documentation workflow (GitHub App, event-based publishing) is eventually decommissioned for that product