fastify / website

https://fastify.dev/
MIT License
60 stars 62 forks source link

Link broken in documentation TypeScript > Type Providers #197

Open danielnmai opened 7 months ago

danielnmai commented 7 months ago

Prerequisites

Fastify version

4.26.2

Plugin version

No response

Node.js version

18.0

Operating system

macOS

Operating system version (i.e. 20.04, 11.3, 10)

14.2.1

Description

The Type Providers link leads to a not found page.

Screenshot 2024-03-04 at 11 02 39 AM Screenshot 2024-03-04 at 11 04 07 AM

Steps to Reproduce

  1. Go to latest doc on TypeScript support
  2. Click on the Type Providers link
  3. Observe the broken page.

Expected Behavior

The Type Providers page should load correctly.

matthyk commented 7 months ago

Should be related to fastify/fastify#5308

matthyk commented 7 months ago

This problem appears with all documentation versions from Fastify version 4.6.x onwards

melroy89 commented 6 months ago

Thanks for reporting I found the same issue. The links itself in markdown are correct, I mean the markdown syntax is correct and the location the link is pointing towards.

Could somebody please take a look at this? I don't know what to do.

For example, this link is broken: https://github.com/fastify/fastify/blob/main/docs/Reference/TypeScript.md?plain=1#L214

The build is showing errors:


 It looks like some of the broken links we found appear in many pages of your site.
Maybe those broken links appear on all pages through your site layout?
We recommend that you check your theme configuration for such links (particularly, theme navbar and footer).
Frequent broken links are linking to:
./Validation-and-Serialization.md/
./Type-Providers.md/
./HTTP2.md/
Logging.md/
./Server.md/#register
./Logging.md/

Exhaustive list of all broken links found:
melroy89 commented 6 months ago

I believe something on the TypeScript page (maybe some strange character?) is breaking all the internal links on the Typescript page. Since the broken links are only present in on the TypeScript page.

sehnsucht13 commented 5 months ago

This issue is caused by using triple backticks for inline code blocks at the start of a new line. The Typescript.md file in the current release contains one instance and that breaks every relative link after it.

docusaurus' parser can't handle that case. The fix is to avoid using triple backticks for inline code blocks. Using a single backtick for inline code will work without a problem.

That specific instance in Typescript.md was removed in PR 5361. Any future releases should have working relative links on the typescript page. Is there any process for backporting changes to older versions of the docs? Older versions of the 4.x release will stay broken if this is not fixed.

I found one other instance in the current docs where there triple backticks are used for inline code blocks. I'll submit a PR for that to avoid any future issues.

melroy89 commented 5 months ago

Thank you for mentioning this! I accidentally fixed the ts doc page🙏.