Repository navigation
check links - #57
check links#57bc1cindy wants to merge 2 commits into
Conversation
yuval-block
left a comment
There was a problem hiding this comment.
i think i overcomplicated it
- let's just add static stubs in a new PR, and each linked PR will rebase on top of it and overwrite the stub
- and make this PR about checking for no broken links, with the stubs in place we can already merge it instead of waiting for the open PRs
range-diff for force push 48c9aed895 → fc11f53833
|
range-diff for force push fc11f53833 → 5ceb07095a
|
range-diff for force push fc11f53833 → 5ceb07095a
|
range-diff for force push 5ceb07095a → ab5ea383e1
|
range-diff for force push 5ceb07095a → ab5ea383e1
|
range-diff for force push ab5ea383e1 → b68e8aa7ff
|
range-diff for force push b68e8aa7ff → 16a87570db
|
range-diff for force push b68e8aa7ff → 16a87570db
|
range-diff for force push 16a87570db → ef52cf7b12
|
range-diff for force push ef52cf7b12 → 89f1d28f93
|
range-diff for force push 3d4790830a → acedb022e8
|
thanks lychee loads certs even with --offline and fails on linux without them. added a comment the site keeps the docs/ paths, so if a link in a chapter works there it works on github too, anchors included. links starting with |
range-diff for force push acedb022e8 → 357ed82e87
|
1 similar comment
range-diff for force push acedb022e8 → 357ed82e87
|
range-diff for force push 357ed82e87 → 3184a4682b
|
1 similar comment
range-diff for force push 357ed82e87 → 3184a4682b
|
range-diff for force push 3184a4682b → cdf5c105ff
|
1 similar comment
range-diff for force push 3184a4682b → cdf5c105ff
|
|
ACK cc2549c (automated): reviewed 2 commits |
cc2549c to
635c89f
Compare
range-diff for force push cc2549c2f3 → 635c89ff8a
|
yuval-block
left a comment
There was a problem hiding this comment.
reACK i think this just needs rebase
lychee checks the HTML offline, so a link to a page or anchor the book does not hold fails the build. The site is checked under /docs/, where it is served, so a link from the root, which mdbook leaves as written, fails too.
GitHub Pages serves the site from /docs/, but mdbook writes 404.html with <base href="/">, its default site-url, so the page shown for a missing path loads its stylesheets, scripts and links from the root of the domain, where none of them exist. lychee resolves relative links against the file, not its <base>, so the link check asserts the page's <base> itself.
635c89f to
9223409
Compare
range-diff for force push 635c89ff8a → 9223409868
|
| links = pkgs.runCommand "links" { nativeBuildInputs = [ pkgs.lychee pkgs.cacert ]; } '' | ||
| # The site is served from /docs/, so a link from the root leaves it. | ||
| mkdir root && ln -s ${site} root/docs | ||
| # lychee resolves links against the file, not its <base>. |
There was a problem hiding this comment.
nit: this comment is not very clear

links to missing files or anchors, and paths that leave the book, fail the build. lychee checks the site mdbook writes, offline, mounted under /docs/ where it is served, so a link from
/fails toolinks to the repository outside
docs/should be absolute URLs; offline, lychee does not check http(s) linkscloses #54
stacked on #50