ci: add link checker to CI (#3707)

## Summary
- Rewrite `tools/check_links.ts` to be more robust (inspired by
denoland/docs' `better_link_checker.ts`)
- Add `deno task check:links` to `deno.json`
- Wire it into CI as a new step (Ubuntu + v2.x only, after `build-www`)
- Add missing `docs/latest/examples/index.md` to fix broken
`/docs/examples` link
- Crawl up to 10 pages concurrently for faster link checking

## What the link checker does
1. Builds the www site with Vite
2. Launches a production server
3. Crawls all internal links starting from the root (10 pages
concurrently)
4. Reports broken links (4xx/5xx) with referrer info
5. Detects empty `href` attributes
6. Prints a summary at the end instead of throwing on first failure

Improvements over the old `check_links.ts`:
- Doesn't throw on first 404 — collects all failures and reports at the
end
- Detects empty hrefs
- Skips non-HTML content, fragment-only links, external links, and
common static file extensions
- Shows referrer for each broken link so you know where to fix it

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Bartek Iwańczuk
2026-03-27 13:49:17 +00:00
committed by GitHub
co-authored by Claude Opus 4.6
parent 7aea4942d7
commit 2c94a1da2e
6 changed files with 245 additions and 45 deletions
+1 -2
View File
@@ -95,8 +95,7 @@ can also be caused by other problems in your deployment configuration.
If you see errors in VS Code like `Cannot find module 'fresh/runtime'` or see a
lot of TypeScript errors, you likely have not installed the Deno extension. You
can easily find it inside VS Code's extension browser (identifier:
`denoland.vscode-deno`) or get it from the
[marketplace](https://marketplace.visualstudio.com/items?itemName=denoland.vscode-deno).
`denoland.vscode-deno`).
Once installed and enabled, the currently installed Deno version should appear
in the bottom status bar. If this does not happen automatically, you can enable
+15
View File
@@ -0,0 +1,15 @@
---
description: |
In this chapter of the Fresh documentation, you can find examples of features that you may like in your Fresh project.
---
In this chapter of the Fresh documentation, you can find examples of features
that you may like in your Fresh project.
- [Active links](./examples/active-links)
- [DaisyUI](./examples/daisyui)
- [Markdown](./examples/markdown)
- [Migration guide](./examples/migration-guide)
- [Rendering raw HTML](./examples/rendering-raw-html)
- [Session management](./examples/session-management)
- [Sharing state between islands](./examples/sharing-state-between-islands)
@@ -4,8 +4,7 @@ description: |
---
All of this content is lifted from this great
[example](https://fresh-with-signals.deno.dev/) by Luca. The source can be found
[here](https://github.com/lucacasonato/fresh-with-signals).
[example](https://github.com/lucacasonato/fresh-with-signals) by Luca.
## Multiple Sibling Islands with Independent State