filiph / linkcheck

Fast link checker
https://pub.dartlang.org/packages/linkcheck
MIT License
426 stars 51 forks source link

Check links in static site on disk? #126

Open emiltin opened 1 year ago

emiltin commented 1 year ago

I'm using Jekyll with GitHub Pages. Jekyll produces a folder with static files. How can I validate links in this static site?

I tried to mount the folder in the container and point to it, but it looks like it does not recognize an url in the form of file://path.

% docker run --rm -v /absolute/path/_site:/_site tennox/linkcheck -d file://_site
Reading URLs:
http://file://_site
Crawl will start on the following URLs: [http://file//_site]
...

The http://file://_sitein the output looks wrong.

hugo-sid commented 1 year ago

I also have a similar use case. I didn't find any documentation regarding this on the repo's readme.

In case linkcheck doesn't support testing static files, I have a workaround in mind:

  1. Install Apache Web Server
  2. Move static files (web pages and assets) to /var/www/html
  3. Run linkcheck with URL http://127.0.0.1/

I have not yet tested this with GitHub action yet.