pkgdown icon indicating copy to clipboard operation
pkgdown copied to clipboard

URL validation

Open bkmgit opened this issue 3 years ago • 1 comments

It would be helpful to validate links that are created by pkgdown and issue a warning if a link cannot be found. Many static site generators do this and it makes site generation and maintenance easier.

bkmgit avatar Oct 19 '22 06:10 bkmgit

This would be easy if we took a dependency on urlchecker.

jayhesselberth avatar Nov 28 '23 17:11 jayhesselberth

Hmmmm, urlchecker does check the .Rd and .Rmd files, but won't check any links that you've added other ways (e.g. in _pkgdown.yml). It's also designed to meet CRANs needs, where you have to resolve redirects. If you're not submitting to CRAN, that's not that useful; and if you are submitting to CRAN, you'll get the checks as part of R CMD check anyway. And we already recommend urlchecker it in our release process (since it's much faster than the built-in method.

So maybe there's nothing to do here?

hadley avatar Apr 30 '24 03:04 hadley

For info, for some (not pkgdown) websites I've seen https://github.com/lycheeverse/lychee-action used

maelle avatar May 03 '24 07:05 maelle

I think that adds to my belief that this isn't pkgdown's responsibility since there are other tools that can do it better (urlchecker as part of the release process will tell you the source of the urls, and lychee or similar will be much faster).

hadley avatar May 03 '24 19:05 hadley