developer-content icon indicating copy to clipboard operation
developer-content copied to clipboard

[workflow]add workflow to check link validation

Open flingjie opened this issue 1 year ago • 3 comments

Problem:

Some links may be invalid in the markdown files.

Summary of Changes:

  • Added file check-links.yaml to .github/workflows.

related issue

https://github.com/solana-foundation/developer-content/issues/12

flingjie avatar Aug 28 '24 08:08 flingjie

This is a good idea! There seems to be some false positives though:

FILE: ./docs/index.md
...
  [✖] /docs/core/programs

But https://solana.com/docs/core/programs exists. Do you know why this is?


Separately: rather than listing what works, it's better to only list what has failed. That allows us to scan test results and find failures very quickly.

mikemaccana avatar Aug 28 '24 17:08 mikemaccana

This is a good idea! There seems to be some false positives though:

FILE: ./docs/index.md
...
  [✖] /docs/core/programs

But https://solana.com/docs/core/programs exists. Do you know why this is?

Separately: rather than listing what works, it's better to only list what has failed. That allows us to scan test results and find failures very quickly.

The checker determines the validity of a link based on whether it can be accessed successfully. When it checks /docs/core/programs, it tries to visit /docs/core/programs, but this fails.

This behavior is inconsistent with the expected check of the address https://solana.com/docs/core/programs.

I’ve added a configuration file that replaces links starting with / with https://solana.com/docs/core/. For example, /docs/core/programs will be replaced with https://solana.com/docs/core/programs. This should give you the expected result.

Also, I have set the checker to quiet mode, so it will only output the invalid links.

Is there anything else you’d like to configure? For example, ignore certain links...

flingjie avatar Aug 29 '24 06:08 flingjie

When it checks /docs/core/programs, it tries to visit /docs/core/programs, but this fails.

This took me a while to understand, but I think you're saying -

When it checks /docs/core/programs, it tries to visit :///docs/core/programs, but this fails.

is that correct?

mikemaccana avatar Sep 05 '24 03:09 mikemaccana

This pull request has been automatically marked as stale because it has not had recent activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Dec 24 '24 00:12 github-actions[bot]