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

Bug: Protocol-Relative URLs in typedoc-sidebar.json when out and docsRoot are the same #695

Closed
m1rn opened this issue Sep 30, 2024 · 1 comment
Labels
bug Issue raised as a bug.

Comments

@m1rn
Copy link

m1rn commented Sep 30, 2024

What package is the bug related to?

typedoc-vitepress-theme

Describe the issue

Description:

There's a bug in the typedoc-vitepress-theme extension when the out and docsRoot configurations are set to the same directory. Specifically, when the following configurations are used:

  • typedoc config: { "out": "./docs/api" }
  • typedoc-vitepress-theme config: { "docsRoot": "./docs/api" }

The resulting typedoc-sidebar.json file generated by typedoc-vitepress-theme contains protocol-relative URLs for links, such as:

"//namespaces/Base/"

This causes an issue in Vitepress where clicking on a link attempts to navigate to http://namespaces/Base/

Expected Behavior:
When the out and docsRoot configurations are the same, the links should be absolute paths relative to the root of the documentation site, like so:

"/namespaces/Base/"

Steps to Reproduce:

  1. Set up typedoc with the configuration: { "out": "./docs/api" }
  2. Set up typedoc-vitepress-theme with the configuration: { "docsRoot": "./docs/api" }
  3. Run the Typedoc generation process.
  4. Check the generated typedoc-sidebar.json file for protocol-relative URLs.
  5. Serve the docs using Vitepress and click on a generated link.

Minimal Reproduction URL:
https://stackblitz.com/edit/stackblitz-starters-jdb3ch?file=package.json

Environment:

  • typedoc version: 0.26.7
  • typedoc-plugin-markdown version: 4.2.8
  • TypeScript version: 5.5.4
  • Node.js version: 5.5.4

TypeDoc configuration

No response

Expected behavior

No response

@m1rn m1rn added the bug Issue raised as a bug. label Sep 30, 2024
@tgreyuk
Copy link
Member

tgreyuk commented Sep 30, 2024

thanks - should be fixed in typedoc-vitepress-theme@1.0.2

@m1rn m1rn closed this as completed Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue raised as a bug.
Projects
None yet
Development

No branches or pull requests

2 participants