This document describes how to use the broken links checker for the Rootstock DevPortal.
The broken links checker validates all links across the documentation. It supports:
- Internal links: Uses Docusaurus built-in link checking during build
- External links: Uses linkinator to check external URLs (local only)
- Checking all locales (loaded dynamically from
docusaurus.config.js) - Checking individual locales (use for fast local testing)
- Detecting broken internal links and broken anchors
- Automatic PR comments with broken links report (internal links only)
Docusaurus has built-in link checking that runs during the build process. The checker:
- Runs
docusaurus buildwith link checking enabled - Parses the build output for broken links and anchors warnings
- Reports all issues with source file and target link information
The script uses warn mode to collect all broken links/anchors, then reports them in a structured format.
Install dependencies first:
yarn install| Command | Description |
|---|---|
yarn check-links |
Check all locales |
yarn check-links:en |
Check English only |
yarn check-links:es |
Check Spanish only |
yarn check-links:ja |
Check Japanese only |
yarn check-links:ko |
Check Korean only |
Note: Locales are loaded dynamically from
docusaurus.config.js. If you add new locales, they will be automatically available.
Tip: Use individual locale commands (e.g.,
yarn check-links:en) for faster builds during local testing.
| Command | Description |
|---|---|
yarn check-links:external |
Check external links (requires build first) |
Note: External link checking requires a built site. Run
yarn buildfirst.
Warning: External link checking can take several minutes depending on the number of links.
The external link checker uses linkinator to crawl the built site and verify all external URLs.
Prerequisites: You must build the project first:
yarn buildThen run the external link checker:
yarn check-links:externalProcess:
- Starts a local server to serve the built site
- Crawls all pages recursively to find external links
- Checks each external URL by making HTTP requests
- Reports results categorized as broken (4xx/5xx), redirects (3xx), or unreachable
| Category | Description |
|---|---|
| Broken | Links returning HTTP 4xx or 5xx status codes (404, 500, etc.) |
| Redirects | Links returning HTTP 3xx status codes (301, 302, etc.) |
| Unreachable | Links that timeout or fail to connect (not counted as broken) |
External link checking may show different results on each run due to:
- Network variability - External sites may respond differently (timeouts, temporary errors)
- Rate limiting - Some sites limit requests and may block or slow responses
- Bot detection - Sites with Cloudflare or similar protection may block automated requests
- Server load - External servers under heavy load may timeout intermittently
The checker uses retry logic (2 retries with jitter) to minimize false positives, but some variation is expected.
The following links are automatically skipped to avoid false positives:
- Links to the site itself (from
docusaurus.config.jsurl) - Social media sites that block bots (Twitter, LinkedIn, Facebook, Instagram)
- Google Tag Manager links
mailto:,tel:, andjavascript:links- Example/placeholder URLs
🔗 Docusaurus Broken Links Checker
Checking internal links using Docusaurus build...
🔍 Checking links for locale: EN
Running docusaurus build with link checking...
[WARNING] Docusaurus found broken links!
...
[WARNING] Docusaurus found broken anchors!
...
============================================================
📊 BROKEN LINKS REPORT
============================================================
📁 Locale: EN
🔗 Broken Links (3):
• Source: /developers/integrate/flyover/
Target: /developers/integrate/flyover/powpeg/
• Source: /developers/integrate/rns/overview/
Target: ./smart-contract/
⚓ Broken Anchors (2):
• Source: /concepts/powpeg/hsm-firmware-attestation/
Target: #powpeg-hsm-firmware-attestation---sovryn
• Source: /dev-tools/data/covalent/
Target: #unified-api
============================================================
📈 SUMMARY
Locales checked: 1
Total broken links: 3
Total broken anchors: 2
Status: ❌ FAILED
============================================================
The broken links checker automatically runs on every pull request that modifies:
docs/**- Documentation filesi18n/**- Translation filessrc/**- Source filesdocusaurus.config.js- Configurationsidebars.js- Sidebar configuration
- On PR creation/update: The workflow builds each locale with link checking
- Parallel checking: All locales are checked in parallel using a matrix strategy
- Comment on PR: If broken links are found, a comment is posted with details
- Status check: The PR check fails if any broken links are found
When broken links are found:
## 🔗 Broken Links Found in en
The build failed due to broken internal links.
<details>
<summary>View broken links</summary>
Broken link on source page path = /developers/quickstart:
-> linking to /docs/non-existent-page
</details>
---
**How to fix:**
1. Check if the linked page exists
2. Update the link to the correct URL
3. If the page was moved, update to the new location
4. If the page was deleted, remove the linkThe link checker behavior is controlled by environment variables in docusaurus.config.js:
| Variable | Default | Description |
|---|---|---|
DOCUSAURUS_BROKEN_LINKS |
warn |
Controls broken links behavior |
DOCUSAURUS_BROKEN_MARKDOWN_LINKS |
warn |
Controls broken markdown links behavior |
DOCUSAURUS_BROKEN_ANCHORS |
warn |
Controls broken anchors behavior |
The check-links script sets these to warn to collect all issues, then reports them.
Ensure all dependencies are installed and environment variables are set:
yarn install
export MENDABLE_KEY=your_key
export COOKBOOK_PUBLIC_API_KEY=your_key
yarn check-links:enIf you get false positives for links that actually work, check:
- The link uses the correct path format (with or without trailing slash)
- The linked page exists in the correct locale
- Anchor links match the actual heading IDs (check for special characters)