projectcontour / contour

Contour is a Kubernetes ingress controller using Envoy proxy.
https://projectcontour.io
Apache License 2.0
3.73k stars 680 forks source link

docs: implement site link checker #3710

Open stevesloka opened 3 years ago

stevesloka commented 3 years ago

Now that Contour has moved on to Hugo the old site link checker can be updated. I played around with htmltest (https://github.com/wjdp/htmltest) which looks neat.

Running it on our site has a bunch of errors that would need cleaned up at the same time this is implemented:

docs/v1.12.0/config/websockets/index.html
  target is a directory, href lacks trailing slash --- docs/v1.12.0/config/websockets/index.html --> /docs/v1.15.1
  target is a directory, href lacks trailing slash --- docs/v1.12.0/config/websockets/index.html --> /docs/v1.15.1
  alt attribute missing --- docs/v1.12.0/config/websockets/index.html --> /img/twitter.png
  alt attribute missing --- docs/v1.12.0/config/websockets/index.html --> /img/slack.png
  alt attribute missing --- docs/v1.12.0/config/websockets/index.html --> /img/rss.png
  alt attribute missing --- docs/v1.12.0/config/websockets/index.html --> /img/github.svg
  target does not exist --- docs/v1.12.0/config/websockets/index.html --> /docs/v1.9.0/config/websockets/
  target is a directory, href lacks trailing slash --- docs/v1.12.0/config/websockets/index.html --> /resources/philosophy
  target is a directory, href lacks trailing slash --- docs/v1.12.0/config/websockets/index.html --> /resources/upgrading
  target is a directory, href lacks trailing slash --- docs/v1.12.0/config/websockets/index.html --> /resources/support
  target is a directory, href lacks trailing slash --- docs/v1.12.0/config/websockets/index.html --> /resources/compatibility-matrix
  target is a directory, href lacks trailing slash --- docs/v1.12.0/config/websockets/index.html --> /resources/deprecation-policy
  target is a directory, href lacks trailing slash --- docs/v1.12.0/config/websockets/index.html --> /resources/release-process
  target is a directory, href lacks trailing slash --- docs/v1.12.0/config/websockets/index.html --> /resources/faq
  target is a directory, href lacks trailing slash --- docs/v1.12.0/config/websockets/index.html --> /resources/tagging
  target is a directory, href lacks trailing slash --- docs/v1.12.0/config/websockets/index.html --> /resources/how-we-work
  Non-OK status: 404 --- docs/v1.12.0/config/websockets/index.html --> https://github.com/projectcontour/contour/edit/master/content/docs/v1.12.0/config/websockets.md?description=Signed-off-by%3A+NAME+%3CEMAIL_ADDRESS%3E%0A%0A
  alt attribute missing --- docs/v1.12.0/config/websockets/index.html --> /img/github-blue.svg
  target is a directory, href lacks trailing slash --- docs/v1.12.0/config/websockets/index.html --> /getting-started
  href blank --- docs/v1.12.0/config/websockets/index.html --> 
docs/v1.12.0/config/request-rewriting/index.html
  target is a directory, href lacks trailing slash --- docs/v1.12.0/config/request-rewriting/index.html --> /docs/v1.15.1
  target is a directory, href lacks trailing slash --- docs/v1.12.0/config/request-rewriting/index.html --> /docs/v1.15.1
  alt attribute missing --- docs/v1.12.0/config/request-rewriting/index.html --> /img/twitter.png
  alt attribute missing --- docs/v1.12.0/config/request-rewriting/index.html --> /img/slack.png
  alt attribute missing --- docs/v1.12.0/config/request-rewriting/index.html --> /img/rss.png
  alt attribute missing --- docs/v1.12.0/config/request-rewriting/index.html --> /img/github.svg
  target does not exist --- docs/v1.12.0/config/request-rewriting/index.html --> /docs/v1.9.0/config/request-rewriting/
  target is a directory, href lacks trailing slash --- docs/v1.12.0/config/request-rewriting/index.html --> /resources/philosophy
  target is a directory, href lacks trailing slash --- docs/v1.12.0/config/request-rewriting/index.html --> /resources/upgrading
  target is a directory, href lacks trailing slash --- docs/v1.12.0/config/request-rewriting/index.html --> /resources/support
  target is a directory, href lacks trailing slash --- docs/v1.12.0/config/request-rewriting/index.html --> /resources/compatibility-matrix
  target is a directory, href lacks trailing slash --- docs/v1.12.0/config/request-rewriting/index.html --> /resources/deprecation-policy
  target is a directory, href lacks trailing slash --- docs/v1.12.0/config/request-rewriting/index.html --> /resources/release-process
  target is a directory, href lacks trailing slash --- docs/v1.12.0/config/request-rewriting/index.html --> /resources/faq
  target is a directory, href lacks trailing slash --- docs/v1.12.0/config/request-rewriting/index.html --> /resources/tagging
  target is a directory, href lacks trailing slash --- docs/v1.12.0/config/request-rewriting/index.html --> /resources/how-we-work
  Non-OK status: 404 --- docs/v1.12.0/config/request-rewriting/index.html --> https://github.com/projectcontour/contour/edit/master/content/docs/v1.12.0/config/request-rewriting.md?description=Signed-off-by%3A+NAME+%3CEMAIL_ADDRESS%3E%0A%0A
  alt attribute missing --- docs/v1.12.0/config/request-rewriting/index.html --> /img/github-blue.svg
  target is a directory, href lacks trailing slash --- docs/v1.12.0/config/request-rewriting/index.html --> /getting-started
  href blank --- docs/v1.12.0/config/request-rewriting/index.html --> 
youngnick commented 3 years ago

That looks great, agreed.

jonasrosland commented 3 years ago

I think this is can be a great first issue for the Contour Tech Docs Working Group, so leaving this open for Thursday's kickoff.

stevesloka commented 3 years ago

I have some WIP work here (https://github.com/projectcontour/contour/compare/main...stevesloka:sitecheck?expand=1) if someone wants to pick it up or I can finish. There are probably a couple of PRs to clean up the issues before doing the actual import bits.