docs
docs copied to clipboard
[CI] Check relative links are correct
Not a priority for now, but it would be nice to have a script that does something like:
- For every markdown file:
- For every link:
- If it's a relative link:
- Check that it resolves to a file in this repo, using the logic that the website uses (no
.mdextension, etc) - Bonus: check that any anchor is correct too
- Check that it resolves to a file in this repo, using the logic that the website uses (no
- If it's a relative link:
- For every link:
Could probably use Erik's link check tool for this again: https://github.com/exercism/v3/blob/main/.github/workflows/valid-links.yml
I've recently found lychee: https://github.com/lycheeverse/lychee This tool is much more full-featured than my tool and a lot faster (it's built in Rust).
Nice. The challenge here is probably the fact that relative links are relative in the context of the website; the therefore the race-condition of new links being added but not merged, so not appearing in the website.
I feel like we probably need to build out the array of all routes from the config.jsons, and then check against that?
Yeah, I think that's probably best
Some actions that we might be able to adapt:
- https://github.com/lycheeverse/lychee-action
- https://github.com/JustinBeckwith/linkinator-action