jaspervdj / hakyll

A static website compiler library in Haskell
jaspervdj.be/hakyll
Other
2.71k stars 409 forks source link

Matrix invite Link get reported as InvalidUrlException #1050

Open UnlimitedCookies opened 2 weeks ago

UnlimitedCookies commented 2 weeks ago

I am unsure whether they are valid URIs, but the check fails for links like https://matrix.to/#/#roomname:matrix.my-cool-server.com with an InvalidUrlException.

UnlimitedCookies commented 2 weeks ago

(this is probably an upstream bug, but I am unsure where to report upstream)

UnlimitedCookies commented 2 weeks ago

It seems like matrix is using non-compliant URIs (https://github.com/matrix-org/matrix.to/issues/17) Is there a way to remove this one error (like writing an <-- #[allow(InvalidUrlException)] --> in the line above)?

LaurentRDC commented 2 weeks ago

If matrix uses non-compliant URIs, there nothing to do currently.

Good news though, Hakyll considers URIs to be strings at first, which are then parsed. If someone was really keen on supporting matrix URIs, then Hakyll could be extended to either:

  1. Have a special rule to parse matrix URIs (modifying this function);
  2. As you mention, add a mechanism to skip the check on certain URIs.

Personally, I am much more partial to solution 1 (handling matrix URIs in a special case). It seems the least disruptive and the most in-keeping with the spirit of ensuring live links.

I am happy to review pull requests.

In the meantime, you can skip checking of external uris using the mysite check --internal-links command.

Rapithvin commented 1 week ago

Hi @LaurentRDC, Can I please work on this ?

LaurentRDC commented 1 week ago

Of course, go ahead