Skip to content

Fix lychee broken-link report (#1884)#1885

Merged
benbalter merged 1 commit into
mainfrom
fix/lychee-broken-links
Jun 16, 2026
Merged

Fix lychee broken-link report (#1884)#1885
benbalter merged 1 commit into
mainfrom
fix/lychee-broken-links

Conversation

@benbalter

Copy link
Copy Markdown
Owner

Addresses #1884 (lychee "Broken links detected" report — 587 errors).

The report splits into three buckets. This PR lands the systematic fix first; the link-rot swaps follow as additional commits.

1. Systematic at:// false positives (125+ errors — the bulk) ✅

Every post emits the spec-required <link rel="site.standard.document" href="at://did:plc:…"> standard.site verification tag (plus the homepage publication tag). lychee 0.24.2 (the action's pinned default) can't parse the at:// scheme — the colons in did:plc:… read as an invalid port — so it throws a hard parse error before any --exclude, --scheme, --remap, or .lycheeignore rule applies (all of those run post-parse). The old ^at:// ignore line was therefore dead code. This produced 125+ false positives per scheduled run, drowning real link rot.

Fix: strip these verification-infrastructure link tags from the throwaway link-check build (after lint-html, before lychee). Production output is unaffected — links.yml builds its own dist-astro and never deploys it. Removed the dead ^at:// rule. Verified site-wide: 0 at:// errors remain.

2. & 3. Dead microsites + external link rot (archive.org swaps) — follow-up commits

Per maintainer direction: replace genuinely-dead links with contemporaneous web.archive.org snapshots (CDX era-closest, not recent parked captures), unlink where no snapshot exists, and leave live links alone (verified — many ERROR-status links like bit.ly/Business Insider just block lychee's bot and return 200).

Separate finding (not in this PR): archived posts 404

src/pages/[year]/[month]/[day]/[slug].astro getStaticPaths uses isPublishedPost, which excludes archived posts — so all 28 archived posts 404, even though PostLayout renders an ArchivedPostWarning banner and plumbs the archived prop for them (currently dead code). ~10 archived posts have inbound links from other content. Recommend a one-predicate fix to build archived posts (with the warning) while keeping them out of listings/feed/sitemap. Flagged for a separate decision.

🤖 Generated with Claude Code

Every post emits the spec-required <link rel="site.standard.document"
href="at://did:plc:…"> tag (plus the homepage publication tag). lychee
0.24.2 can't parse the at:// scheme — the colons in did:plc:… read as an
invalid port — so it throws a hard parse error that no --exclude,
--scheme, --remap, or .lycheeignore rule can suppress (they all run after
URL parsing). This produced 125+ false-positive errors per scheduled run,
drowning real link rot.

Strip these verification-infrastructure link tags from the throwaway
link-check build (after lint-html, before lychee). Production output is
unaffected: links.yml builds its own dist-astro and never deploys it.
Remove the now-confirmed-dead ^at:// .lycheeignore rule.

Refs #1884

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@benbalter benbalter merged commit 13b5a6e into main Jun 16, 2026
7 of 9 checks passed
@benbalter benbalter deleted the fix/lychee-broken-links branch June 16, 2026 00:11
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