Skip to content

feat: add lychee link checker#10

Merged
mroderick merged 1 commit intomainfrom
add-link-checker
Apr 27, 2026
Merged

feat: add lychee link checker#10
mroderick merged 1 commit intomainfrom
add-link-checker

Conversation

@mroderick
Copy link
Copy Markdown
Contributor

Summary

Add automated link checking using lychee to detect broken links in the built VitePress site.

Changes

  • package.json: Add
    pm run lint:links/script to run link checker locally
  • scripts/link-check.sh: Shell script for local link checking using lychee
  • .github/workflows/link-check.yml: GitHub Actions workflow for automated link checking on CI

How it works

The link checker:

  • Runs against the built
    .vitepress/dist older (not source files)
  • Excludes local
    file://
    URLs
  • Accepts 200-299 and 403 status codes (npm returns 403 for bots)
  • Runs on push to main, pull requests, and daily schedule
  • Creates GitHub issues for broken link reports

Usage

build
vitepress build

vitepress v2.0.0-alpha.17

build complete in 6.72s.

lint:links
./scripts/link-check.sh

Running lychee link check on dist folder...
🔍 518 Total (in 1s 139ms) 🔗 228 Unique ✅ 116 OK 🚫 0 Errors 👻 383 Excluded ⛔ 19 Unsupported 🔀 12 Redirects

Notes

  • 12 redirect warnings are expected (YouTube URLs redirect normally)
  • npmjs.com links return 403 but are accepted as valid
  • Uses Homebrew-installed lychee locally, lycheeverse/lychee-action on CI

Add automated link checking using lychee to detect broken links
in the built VitePress site.

Changes:
- Add npm script 'lint:links' to run link checker locally
- Create scripts/link-check.sh for local link checking
- Add GitHub workflow for automated link checking on CI

The link checker:
- Runs against the built dist folder
- Excludes local file:// URLs
- Accepts 200-299 and 403 status codes
- Runs on push, PR, and daily schedule

Refs: lycheeverse/lychee-action
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1b23acb
Status: ✅  Deploy successful!
Preview URL: https://746287fc.website-33l.pages.dev
Branch Preview URL: https://add-link-checker.website-33l.pages.dev

View logs

@mroderick mroderick marked this pull request as ready for review April 27, 2026 20:01
@mroderick mroderick merged commit 4257c03 into main Apr 27, 2026
4 checks passed
@mroderick mroderick deleted the add-link-checker branch April 27, 2026 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant