- Notifications
You must be signed in to change notification settings - Fork121
hashicorp/web-unified-docs
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Important
This README is for developers working on the documentation website. If youwant to contribute docs content, refer to theContribute to HashiCorpdocumentation guide.
The project in this repository,hashicorp/web-unified-docs, aims to implement[DEVDOT-023] Unified Product Documentation Repository. The RFC for this project was intentionally light on implementation details, in order to foster consensus on the broad direction.
- PR previews: Show broken links in comments for awareness (informational only, don't block PRs)
- Production monitoring: Weekly scans create GitHub issues and send critical alerts to Datadog when users are affected
The weeklybroken-link-check-full workflow generates comprehensive broken link reports with prioritization guidance. When contributors create PRs that modify content, the link checker shows any broken links in PR comments with actionable guidance without blocking development.
Quick tips for contributors:
- Fix internal HashiCorp links (high priority)
- Check external docs/API links (medium priority)
- Consider removing unreliable external links (low priority)
For detailed information about the monitoring system, seeBroken LinkMonitoring Documentation. TheUnified Product DocumentationRepository RFCfor this project was intentionally light on implementation details, in orderto foster consensus on the broad direction.
The existing API (content.hashicorp.com) has endpoints that serve documentation content. You can find the source code inhashicorp/mktg-content-workflows.
The goal of the unified docs API is to host all of HashiCorp's product documentation. The unified docs API will eventually replace the existing content API.
- Docker andDocker Compose (for managing containers)
To get a migration preview running, runmake from the root of this repo. Themake command starts theunified-docs Docker profile that spins up a local instance ofunified-devdot-api anddev-portal.
Once this command completes, you can access the following endpoints:
http://localhost:3000 - An instance of the
dev-portalcontainer configured to pull from the experimental docs API (this repo). This image depends on the unified docs API (unified-devdot-api).http://localhost:8080 - An instance of the unified docs API container (this repo -
unified-devdot-api) that serves content from thecontentdirectory. On startup, this container processes the content and assets in/contentintopublic/assetsandpublic/content. In addition, the container also generatesapp/api/docsPaths.jsonandapp/api/versionMetadata.jsonfrom the contents within/content.Use the following example to test this endpoint:http://localhost:8080/api/content/terraform-plugin-framework/doc/latest/plugin/framework
Note
The unified docs API container takes time to process the content and assets. You must wait for both theunified-devdot-api anddev-portal containers to complete before you can successfully test content in thedev-portal preview environment (localhost:3000). Visithttp://localhost:8080/api/all-docs-paths to verify theunified-devdot-api container is complete.
To spin this down gracefully, runmake clean in a separate terminal.
If you wish to remove the local Docker images as well, runmake clean CLEAN_OPTION=full.
Themakefile serves as a convenience tool start the local preview. If you need more granular control, thepackage.json file contains a full list of available commands.
To use these, you will need to intentionally runnpm install andnpm run prebuild before anything else.
Usenpm run coverage to run coverage tests.
Unified docs API serves as one of the content APIs fordev-portal (frontend application for DevDot). As a result, when implementing new features, you may need to modify both the backend (this repo) and the frontend (dev-portal).
If you are working on a ticket that requires changes to both the unified docs API anddev-portal, please setcustom environment variables for your branch in Vercel to simplify testing instructions.
For example, in Vercel, for yourdev-portal branch, you can set the following environment variables:
| Environment variable | Value |
|---|---|
HASHI_ENV | unified-docs-sandbox |
UNIFIED_DOCS_API | <UDR-Preview-URL> |
Vercel will use these values to create deploy previews.
Reach out to team #team-web-presence if you need to do local API development
- Storing documentation in one branch of one repo dramatically simplifies the workflow for contributing documentation.
- Publishing changes to multiple versions can be done in a single PR, as opposed to multiple PRs which is required by the current setup.
- Finding and making the same change across multiple versions is as simple as doing a find-and-replace since all the versioned docs are on the filesystem at the same time.
- Adding a new product is as easy as making a new folder, as opposed to the current process which requires code-changes on the API side and the installation of a GitHub App to monitor for events.
- Sourcing from one branch in one repo eliminates the situation where a missed GitHub event can result in out-of-date documentation. If something goes wrong in the publishing process, simply run it again instead of relying on incoming commit/release events from the GitHub API.
- Since we can make edits to all docs for all products and versions from a single PR, making platform-level changes is dramatically simplified (such as updating to MDX v2, or rewriting URLs).
- Adding new features like content conformance (basically linting for docs) can be done for the entire codebase at once.
- Removes the ability for docs to break the release workflow in product repos.
- Enables us to support fully versioned deployment previews, whereas current previews are limited to the branch being modified.
This script helps with product documentation migration to the web-unified-docs repository. When migrating documentation:
- The
web-unified-docsrepository becomes the source of truth - Original documentation may remain temporarily as a fallback
- Users should be directed to make future changes in
web-unified-docsonly
This script automatically adds a prominent notice to all MDX files in the original location, informing contributors where to make future changes.
./scripts/update-mdx-files.sh ~/Desktop/hashicorp/terraform-plugin-framework/website/docsExample output:
Progress:Files processed: 135Files updated: 135Files with no frontmatter: 0Files with errors: 0Completed! All MDX files have been processed.The repository uses a focused broken link monitoring system:
- PR previews: Show broken links in comments for awareness (informational only, don't block PRs)
- Production monitoring: Weekly scans create GitHub issues and Datadog alerts for user-facing problems
The weeklybroken-link-check-full workflow generates comprehensive broken link reports. When contributors create PRs that modify content, the link checker shows any broken links in PR comments without blocking development.
For detailed information about the monitoring system, seeBroken Link Monitoring Documentation.
For teams migrating products to UDR (Unified Docs Renderer), use the dedicated migration workflow:
- Go toActions → UDR Product Link Check
- Click "Run workflow" and select your product
- Review migration-specific broken link analysis in the generated GitHub issue
This workflow provides targeted link checking with migration-focused reporting and prioritization.
You can also run the broken link checker locally. The following commands launch a lychee Docker container to check the content directories you specify.
Run the broken link checker on all content.
npm run broken-linkCheck a specific directory within content.
npm run broken-link terraform-plugin-frameworkCheck multiple directories.
npm run broken-link terraform-plugin-framework-log terraform-plugin-muxThe following diagram illustrates the relationships between the unified docs API (this repo),dev-portal, and the existing content API:
graph LR subgraph "Content sources (non-migrated)" BDY[boundary] CSL[consul] HCP[hcp-docs] NMD[nomad] PKR[packer] SNT[sentinel] TF[terraform] TFC[terraform-cdk] TFA[terraform-docs-agents] TFD[terraform-docs-common] VGT[vagrant] VLT[vault] WPT[waypoint] CURALL["/content or /website"] BDY & CSL & HCP & NMD & PKR & SNT & TF & TFC & TFA & TFD & VGT & VLT & WPT --> CURALL end subgraph "Migrated content repo" TPF[terraform-plugin-framework] TPL[terraform-plugin-log] TPM[terraform-plugin-mux] TPS[terraform-plugin-sdk] TPT[terraform-plugin-testing] TFE[terraform-enterprise] MIGALL["/content"] TPF & TPL & TPM & TPS & TPT & TFE --> MIGALL end subgraph "APIs" CP[Content API<br>content.hashicorp.com] UDR[Unified Docs Repository<br>web-unified-docs] end subgraph "Frontend" DP[Dev Portal<br>dev-portal] end %% BDY & CSL & HCP & NMD & PKR & PTF & SNT & TF & TFC & TFA & TFD & VGT & VLT & WPT --> CP %% TPF & TPL & TPM & TPS & TPT --> UDR CURALL -->|Current content flow| CP MIGALL -->|Migrated content| UDR CP -->|Serves most content| DP UDR -->|Serves unified/content content| DP class TPF,TPL,TPM,TPS,TPT,BDY,CSL,HCP,NMD,PKR,PTF,SNT,TF,TFC,TFA,TFD,VGT,VLT,WPT productRepoThe diagram shows:
- The content API — the existing system that sources product documentation content from product repositories
- The unified docs API — the new system that sources product documentation from this repo's
/contentdirectory. The migrated repos will use a directory approach to versioning (rather than the historic branch and tag strategy) - The Dev Portal — the frontend that serves the main DevDot interface. Dev Portal sources its content from both the existing content API and unified docs API.
About
Hashicorp Unified Docs
Resources
License
Code of conduct
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.