ONEARMY / academy

Precious plastic academy
https://onearmy.github.io/academy
GNU General Public License v3.0
16 stars 20 forks source link

[FEATURE REQUEST] Add a way to check for dead links #127

Closed darigovresearch closed 2 years ago

darigovresearch commented 3 years ago

One of the most common feedbacks for the academy is that there is a dead link that needs to be fixed.

Is there any way that we can make this an automatic check in the GitHub for this in the continuous integration checks or in Docusaurus?

runningdeveloper commented 3 years ago

Hi here is a github action that might help https://github.com/lycheeverse/lychee-action

darigovresearch commented 3 years ago

@runningdeveloper thanks for raising this potential solution. @chrismclarke what do you think?

chrismclarke commented 3 years ago

I really like the idea of using a github action, that way we can set it up as a cron task to check regularly (e.g. if something has been moved) instead of during deployment (which doesn't happen very often).

I've just opened up a PR to test: https://github.com/ONEARMY/academy/pull/142

You can see the full output from the run here: https://github.com/ONEARMY/academy/runs/3786194423?check_suite_focus=true

It also created an issue from the report here: https://github.com/ONEARMY/academy/issues/141

I'm guessing it needs some extra configuration because it's showing a lot of file errors which I don't think are accurate, but maybe someone else can confirm/test a bit more? Feel free to make any updates to the PR if wanting to check/test

I also saw this action: https://github.com/gaurav-nelson/github-action-markdown-link-check Not sure if there's much difference, happy with whatever works myself

chrismclarke commented 3 years ago

I just updated the link checker to run after the site is built (to try and fix incorrect asset paths) and the output is better but still seems to report a few false-positives. What do you think @darigovresearch @runningdeveloper ?

Second check output: https://github.com/ONEARMY/academy/issues/143

chrismclarke commented 3 years ago

Run 3: https://github.com/ONEARMY/academy/issues/145

I tested locally using the tool from command line and actually the output was looking much nicer (only a couple broken links), so I just tried bumping the version to latest (docs were outdated) and this time looking better again. I also reverted the build step as appears to be working from raw markdown which is a bit faster

darigovresearch commented 3 years ago

@chrismclarke nice work. GitHub actions seems like a good approach. Showing the error page & the link that is not working is really helpful!