Support absolute anchors when Storybook is deployed at non-root
See original GitHub issueDescribe the bug
When Storybook is deployed at an URL like https://example.com/storybook/component-library/v48.3.2/
, the anchors within docs content will remove the base url.
E.g. when you’re on https://example.com/storybook/component-library/v48.3.2/?path=/docs/components-icon--default
and you have a link to /docs/components-button--default
in the documentation, the resulting link will point to https://example.com/?path=/docs/components-button--default
.
To Reproduce
Steps to reproduce the behavior:
- Build a storybook locally
- Run
npx http-server
in a parent folder - Navigate to the storybook
- Try clicking on a link as described above and it will fail
Expected behavior
The base url of the deployment should be considered for the link.
System:
System:
OS: macOS 10.15.4
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Binaries:
Node: 12.3.1 - /usr/local/bin/node
Yarn: 1.22.4 - ~/.yarn/bin/yarn
npm: 6.14.3 - ~/Projects/alpine/component-library/node_modules/.bin/npm
Browsers:
Chrome: 83.0.4103.116
Edge: 81.0.416.53
Firefox: 77.0.1
Safari: 13.1
npmPackages:
@storybook/addon-actions: ^5.3.19 => 5.3.19
@storybook/addon-docs: ^5.3.19 => 5.3.19
@storybook/addon-storyshots: ^5.3.19 => 5.3.19
@storybook/addons: ^5.3.19 => 5.3.19
@storybook/csf: ^0.0.1 => 0.0.1
@storybook/react: ^5.3.19 => 5.3.19
@storybook/theming: ^5.3.19 => 5.3.19
Additional context
I’ve created a PR that should solve this here: https://github.com/storybookjs/storybook/pull/11403
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
storybook 6.0.0-rc.19 on Node.js Yarn - NewReleases.io
New release storybook version 6.0.0-rc.19 on Node.js Yarn. ... Addon-docs: Support absolute anchors when deployed at non-root (#11403) ...
Read more >Publish Storybook
Storybook is a frontend workshop for building UI components and pages in isolation. Thousands of teams use it for UI development, testing, and...
Read more >@storybook/addon-jest | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >Apache HBase ™ Reference Guide
Commercial technical support for Apache HBase is provided by many Hadoop ... HBase runs on the Java Virtual Machine, thus all HBase deployments...
Read more >TADDM Capabilities and Best Practices - IBM Redbooks
8.1 Integrating TADDM with IBM Tivoli Business Service Manager . . . . . . . 381 ... Depending on your network, you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ooh-la-la!! I just released https://github.com/storybookjs/storybook/releases/tag/v6.0.0-rc.19 containing PR #11403 that references this issue. Upgrade today to try it out!
You can find this prerelease on the
@next
NPM tag.Closing this issue. Please re-open if you think there’s still more to do.
Cool, hope it’ll be merged soon