GitHub - hashicorp/web-unified-docs: Hashicorp Unified Docs (original) (raw)

Web Unified Docs


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.

The weekly broken-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:

For detailed information about the monitoring system, see Broken Link Monitoring Documentation. The Unified Product Documentation Repository RFCfor this project was intentionally light on implementation details, in order to foster consensus on the broad direction.

The existing API (content.hashicorp.com) has endpoints that serve documentation content. You can find the source code in hashicorp/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.

Local development

Requirements

Quick start

To get a migration preview running, run make from the root of this repo. The make command starts the unified-docs Docker profile that spins up a local instance of unified-devdot-api and dev-portal.

Once this command completes, you can access the following endpoints:

Note

The unified docs API container takes time to process the content and assets. You must wait for both the unified-devdot-api and dev-portal containers to complete before you can successfully test content in the dev-portal preview environment (localhost:3000). Visit http://localhost:8080/api/all-docs-paths to verify the unified-devdot-api container is complete.

To spin this down gracefully, run make clean in a separate terminal.

If you wish to remove the local Docker images as well, run make clean CLEAN_OPTION=full.

More commands

The makefile serves as a convenience tool start the local preview. If you need more granular control, the package.json file contains a full list of available commands.

To use these, you will need to intentionally run npm install and npm run prebuild before anything else.

Use npm run coverage to run coverage tests.

Preview environments for unified-docs and dev-portal

Unified docs API serves as one of the content APIs for dev-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 and dev-portal, please set custom environment variables for your branch in Vercel to simplify testing instructions.

For example, in Vercel, for your dev-portal branch, you can set the following environment variables:

Environment variable Value
HASHI_ENV unified-docs-sandbox
UNIFIED_DOCS_API

Vercel will use these values to create deploy previews.

API development

Reach out to team #team-web-presence if you need to do local API development

Background

Project Rationale

Architectural Decision Records

Update product repo documentation

This script helps with product documentation migration to the web-unified-docs repository. When migrating documentation:

  1. The web-unified-docs repository becomes the source of truth
  2. Original documentation may remain temporarily as a fallback
  3. Users should be directed to make future changes in web-unified-docs only

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/docs

Example output:

Progress:

Files processed: 135
Files updated: 135
Files with no frontmatter: 0
Files with errors: 0

Completed! All MDX files have been processed.

The repository uses a focused broken link monitoring system:

The weekly broken-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, see Broken Link Monitoring Documentation.

For teams migrating products to UDR (Unified Docs Renderer), use the dedicated migration workflow:

  1. Go to Actions → UDR Product Link Check
  2. Click "Run workflow" and select your product
  3. Review migration-specific broken link analysis in the generated GitHub issue

This workflow provides targeted link checking with migration-focused reporting and prioritization.

Local Testing

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.

Check a specific directory within content.

npm run broken-link terraform-plugin-framework

Check multiple directories.

npm run broken-link terraform-plugin-framework-log terraform-plugin-mux

Architecture

The 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 productRepo

Loading

The diagram shows: