Bug: Protocol-Relative URLs in `typedoc-sidebar.json` when out and docsRoot are the same
Closed this issue · 1 comments
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:
- Set up
typedoc
with the configuration:{ "out": "./docs/api" }
- Set up
typedoc-vitepress-theme
with the configuration:{ "docsRoot": "./docs/api" }
- Run the Typedoc generation process.
- Check the generated
typedoc-sidebar.json
file for protocol-relative URLs. - 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
thanks - should be fixed in typedoc-vitepress-theme@1.0.2