Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📘 DOC: Lint for broken links in all languages #103

Closed
jasikpark opened this issue Dec 24, 2021 · 5 comments
Closed

📘 DOC: Lint for broken links in all languages #103

jasikpark opened this issue Dec 24, 2021 · 5 comments
Labels
i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help!

Comments

@jasikpark
Copy link
Contributor

Currently we have a yarn lint:linkcheck:local command that can check for broken links, but we don't have any way to switch what language you're using without JS, so it only checks the English pages.

I want to write a script using the programmatic version of blc to check all translations of the docs for broken links!

@FredKSchott FredKSchott transferred this issue from withastro/astro Jan 29, 2022
@sarah11918
Copy link
Member

This is old, and possibly out-of-date, but is this something you might be interested in exploring, @hippotastic ? Even if only to triage and let me know whether to close this issue, or to try and tackle it yourself?

@hippotastic
Copy link
Contributor

Sure @sarah11918, why not! I'll have a look 🙂

@hippotastic
Copy link
Contributor

I've implemented it myself. See my PR above. The output looks like this:

/da/getting-started/
  ❌ https://docs.astro.build/quick-start
  ❌ https://docs.astro.build/installation
  ❌ https://docs.astro.build/reference/builtin-components

/de/core-concepts/component-hydration/
  🔗 https://docs.astro.build/de/core-concepts/component-hydration/#mycomponent-clientonly-

/de/core-concepts/routing/
  🔗 https://docs.astro.build/reference/api-reference#getstaticpaths

/de/getting-started/
  ❌ https://docs.astro.build/reference/builtin-components

[...]

*** Found 76 broken links.

When a link leads to a 404 page, the target href is prefixed by a ❌.
When the target page exists, but the link contains an URL hash that does not exist on that page, the prefix is 🔗.

@hippotastic
Copy link
Contributor

@sarah11918 This issue can be closed now, my PR got merged. 🎉

@sarah11918 sarah11918 added the i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help! label Apr 22, 2022
@sarah11918
Copy link
Member

YAY! 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help!
Projects
None yet
Development

No branches or pull requests

3 participants