HiDeoo / starlight-links-validator

Starlight plugin to validate internal links
https://starlight-links-validator.vercel.app
MIT License
62 stars 5 forks source link

Error for static Assets #7

Closed lorenzolewis closed 1 year ago

lorenzolewis commented 1 year ago

Describe the bug

When linking to a non-route asset (such as something in the public folder), this plugin will treat them as a broken link.

To Reproduce

  1. Add an asset to the public (i.e. public/data.csv)
  2. Link to that asset from a markdown file (i.e. [file](/data.csv))
  3. Build fails

Expected behavior

Maybe this could ignore any links that end in a file extension? I'm not sure if special exceptions would need to be made for .md, .mdx, .html, and other common extensions that might be left behind as a result of someone migrating from a documentation platform that might expect them.

How often does this bug happen?

Every time

System Info

"astro": "^2.10.14", "@astrojs/starlight": "^0.7.3", "starlight-links-validator": "^0.2.0"

Additional Context

No response

HiDeoo commented 1 year ago

Good catch! Thanks for the thorough report as usual 🙌

This should be fixed in the new v0.3.0. I ended up literally checking the build output directory which should be a more reliable source of truth and should also account for potential other integrations adding files to the build output directory.