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: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "tools/docusaurus-link-checker"]
path = tools/docusaurus-link-checker
url = https://github.com/ethersphere/docusaurus-link-checker.git
29 changes: 13 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ The site serves two files for AI agents at the root:

### Keeping `llms.txt` up to date

The validation script `scripts/validate-llms-txt.mjs` runs automatically during `npm run build` (via the `prebuild` hook). It cross-checks `static/llms.txt` against the actual doc files and prints warnings for:
The script `scripts/check-llms-coverage.mjs` runs automatically after every build (via the `postbuild` hook). It cross-checks `static/llms.txt` against the actual build output (`build/docs/`) and prints warnings for:

- **Stale links** — a URL in `llms.txt` points to a doc page that no longer exists (renamed/deleted).
- **Missing coverage** — a doc file exists that isn't listed in `llms.txt` (new page added without updating the index).
- **Stale links** — a URL in `llms.txt` points to a page that no longer exists in the build.
- **Missing coverage** — a built page isn't listed in `llms.txt`.

The script is **informational only** (exit 0) — it won't block the build.

Expand All @@ -86,21 +86,24 @@ A few pages are intentionally excluded (intro/landing pages that only contain na

## 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:
The link checker scripts live in `scripts/` and are written in TypeScript. They require no additional installation beyond `npm ci` (which installs `tsx`).

### Usage

Run the checker against a local build:

```bash
git submodule update --init
npm run build # build the site first
npm run check:links # check the local build
```

### Usage

Run the checker from the repo root:
Or build and check in one step:

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

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

```bash
npm run check:links -- --mode local
Expand All @@ -115,12 +118,6 @@ npm run check:links -- --mode local --no-external --threads 16
| `--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
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion docusaurus.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default {
'@docusaurus/preset-classic',
{
docs: {
sidebarPath: './sidebars.js', // Simplified path for ESM
sidebarPath: './sidebars.cjs',
editUrl: 'https://github.com/ethersphere/docs.github.io/blob/master',
remarkPlugins: [remarkMath], // Now using imported ESM modules
rehypePlugins: [rehypeKatex],
Expand Down
Loading
Loading