Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "tools/docusaurus-link-checker"]
path = tools/docusaurus-link-checker
url = https://github.com/ethersphere/docusaurus-link-checker.git
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,45 @@ The script is **informational only** (exit 0) — it won't block the build.

A few pages are intentionally excluded (intro/landing pages that only contain navigation cards). Their warnings are expected and can be ignored.

## Link Checker

This repo includes [ethersphere/docusaurus-link-checker](https://github.com/ethersphere/docusaurus-link-checker) as a git submodule at `tools/docusaurus-link-checker`. After cloning, initialise it with:

```bash
git submodule update --init
```

### Usage

Run the checker from the repo root:

```bash
npm run check:links
```

You will be prompted to choose local or live mode. Flags are passed through after `--`:

```bash
npm run check:links -- --mode local
npm run check:links -- --mode live --site-domain docs.ethswarm.org
npm run check:links -- --mode local --no-external --threads 16
```

| Flag | Description |
|---|---|
| `--mode local\|live` | Local build check (default) or live site crawl |
| `--site-domain` | Your site's domain — auto-detected from `docusaurus.config.*` if omitted |
| `--no-external` | Skip external URL checking (local mode only) |
| `--threads N` | Number of concurrent HTTP threads (default: 8) |

To run the full build and then immediately check links:

```bash
npm run build:check
```

Reports are written to `link-reports/` (gitignored).

## Bumping Version

Don't forget to find and replace the version number for the whole of the docs folder.
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"serve": "docusaurus serve",
"check:links": "python scripts/check_links.py"
"precheck:links": "git submodule update --remote tools/docusaurus-link-checker",
"check:links": "python tools/docusaurus-link-checker/check_links.py",
"build:check": "npm run build && python tools/docusaurus-link-checker/check_links.py"
},
"dependencies": {
"@docsearch/js": "^4.3.2",
Expand Down
Loading
Loading