To date, we've been using urlstechie/urlchecker-action to check links in the site. The problem, however, is that the action is quite general -- it will scan any file you tell it to for things that look like URLs and it doesn't understand the semantics of the content, so it doesn't know if the URL is actually in a block that's been commented out, for example.
This has been causing some headaches recently because a typical strategy I use is to comment out bad links (with commentary annotations) so that we have a reminder that maybe we should check again for that content in the future. Similarly, in some cases, for example for event artifacts, I can anticipate what the links to certain artifacts will be and include them when I'm creating the event, but leave them commented out until the artifacts are actually posted.
Finally, we're now using JSON data files from SPDX and the OpenSSF badging site which have lots of links in them -- almost all of which we don't care about. Because of this, we're currently excluding JSON files from being link checked. But the better approach would be to check the links that we are actually using.
Which brings me to the idea of checking the generated site rather than checking all of the sources. This would limit it to the links which we're actually using at any given point in time, assuming the checker does understand HTML semantics.
One possible solution appears to be html-proofer, used as described here:
There may well be other similar solutions out there. I haven't looked further (yet).
To date, we've been using
urlstechie/urlchecker-actionto check links in the site. The problem, however, is that the action is quite general -- it will scan any file you tell it to for things that look like URLs and it doesn't understand the semantics of the content, so it doesn't know if the URL is actually in a block that's been commented out, for example.This has been causing some headaches recently because a typical strategy I use is to comment out bad links (with commentary annotations) so that we have a reminder that maybe we should check again for that content in the future. Similarly, in some cases, for example for event artifacts, I can anticipate what the links to certain artifacts will be and include them when I'm creating the event, but leave them commented out until the artifacts are actually posted.
Finally, we're now using JSON data files from SPDX and the OpenSSF badging site which have lots of links in them -- almost all of which we don't care about. Because of this, we're currently excluding JSON files from being link checked. But the better approach would be to check the links that we are actually using.
Which brings me to the idea of checking the generated site rather than checking all of the sources. This would limit it to the links which we're actually using at any given point in time, assuming the checker does understand HTML semantics.
One possible solution appears to be
html-proofer, used as described here:There may well be other similar solutions out there. I haven't looked further (yet).