Skip to content

Use hints for root-relative links error#2197

Merged
thomas-zahner merged 6 commits into
lycheeverse:masterfrom
rina-forks:relocatable-hint
May 29, 2026
Merged

Use hints for root-relative links error#2197
thomas-zahner merged 6 commits into
lycheeverse:masterfrom
rina-forks:relocatable-hint

Conversation

@katrinafyi

Copy link
Copy Markdown
Member

Fixes #2195 by moving the suggestion into a user hint and adding a sentence about possible impacts on relocatable sites.

New error looks like:

Issues found in 1 input. Find details below.

[a.md]:
 [ERROR] error: (at 4:1) | Cannot resolve root-relative link '/a'

🔍 3 Total (in 60ms) 🔗 3 Unique ✅ 0 OK 🚫 3 Errors

Hint: Unresolved root-relative links in local files. To resolve root-relative links to a local directory, provide a root dir. Alternatively, if the site should be relocatable, consider using locally-relative links.

Happy to tweak any part of the phrasing.

I've kept it as "locally-relative" (rather than @ roberth's suggestion of page-/document-relative), because I think it's more straightforward when it refers to files on disk. Page and document both need the user to think about web pages before connecting it a file path. MDN calls them current directory relative. That's a bit long but I also wouldn't mind "directory-relative".

Comment thread lychee-bin/src/hints.rs Outdated
Comment thread lychee-bin/src/hints.rs Outdated
Comment thread lychee-bin/src/hints.rs Outdated
@thomas-zahner thomas-zahner merged commit 66dbc82 into lycheeverse:master May 29, 2026
7 checks passed
@thomas-zahner

Copy link
Copy Markdown
Member

@katrinafyi Thank you for the PR and the extensive discussion on #2195! 🚀

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.

UX improvement for path-relocatable sites?

2 participants