Skip to content

refactor: Optimize lychee link exclusion configuration (#12021)#12022

Merged
KATO-Hiro merged 9 commits intomasterfrom
#12021
Apr 26, 2026
Merged

refactor: Optimize lychee link exclusion configuration (#12021)#12022
KATO-Hiro merged 9 commits intomasterfrom
#12021

Conversation

@KATO-Hiro
Copy link
Copy Markdown
Owner

close #12021

KATO-Hiro and others added 9 commits April 26, 2026 14:11
- Remove all markdown-link-check-disable HTML comment tags (84 pairs)
- Add exclude_path to lychee.toml for archived pages with intentional broken links
- Add 10 domain patterns to lychee.toml exclude (3+ occurrence threshold)
- Consolidate .lycheeignore: 40 → 11 URLs (remove domains managed in lychee.toml)
- Create .claude/rules/link-checking.md: Link exclusion strategy guide
- Update .claude/rules/tools.md: Document lychee limitations
- Update survey.md with confirmed analysis results

This improves maintainability by preventing new links in excluded domains from
triggering CI failures, and centralizing domain exclusion in lychee.toml.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
lychee interprets relative paths as file system paths, which conflicts
with MkDocs' URL transformation. Since relative links are internal to
the site structure and not resolvable by the tool, exclude them from
validation.

Resolves ~500 false positives from relative path checking.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Lychee was not correctly resolving relative paths in Markdown files
(including image references like ../../images/chrome_extension/*.png)
because the working directory context was missing. The --base option
ensures relative paths are resolved correctly from the repository root.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
The --base option in lychee-action now correctly resolves relative
paths, so excluding them is unnecessary and would hide bugs in
internal links.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
…tion

lychee's --root-dir option must be an absolute path (not relative like .)
to properly resolve relative paths in markdown files. In GitHub Actions,
${{ github.workspace }} provides the absolute path to the repository root.

This fixes the issue where relative paths like ../../images/... in
markdown files were being calculated incorrectly, resulting in
file:// URLs missing the docs/ directory prefix.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
…match

Image paths in markdown are written relative to MkDocs build output
(e.g. ../../images/ from archived/outdated_information/),
but lychee resolves paths against the source tree where docs/ is the
root — causing false negatives for all local file references.

Excluding file:// limits lychee to HTTP/HTTPS link validation,
which is the intended use case.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This archived page contains image paths written for MkDocs build output
and likely has stale external links — consistent with the other
excluded archived pages.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Owner Author

@KATO-Hiro KATO-Hiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@KATO-Hiro KATO-Hiro merged commit b770998 into master Apr 26, 2026
1 check passed
@KATO-Hiro KATO-Hiro deleted the #12021 branch April 26, 2026 22:06
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