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

Add support for subpaths #16

Merged
merged 3 commits into from
Oct 13, 2024
Merged

Conversation

patcon
Copy link
Contributor

@patcon patcon commented Oct 8, 2024

Resolves: #9

Not documented yet, but only because I'm suspicious I solved it in the wrong way. Avoiding location.pathname.replace() in favour of just returnin /${target}/ seems to resolve the issue as I've added tests for. The tests only broke with the logic we had before.

Will try on an actual site, but hoping this resolves the issue!

@patcon
Copy link
Contributor Author

patcon commented Oct 8, 2024

Confirmed that this change builds a website that works fine here: https://civictechto.github.io/polis-storybook/ (unlike how it was broken earlier)

Added tests to validate it works. Lemme know if it looks good, and I'll add some docs :)

src/util/location.ts Show resolved Hide resolved
@utarwyn utarwyn added bug Something isn't working patch Increment the patch version when merged labels Oct 10, 2024
@patcon
Copy link
Contributor Author

patcon commented Oct 10, 2024

Thanks! Am happy to document this tonight or tomorrow (or can be separate PR if you merge before I find time)

@patcon
Copy link
Contributor Author

patcon commented Oct 11, 2024

Ok, added some documentation on subpath hosting to the bottom of the README. Lemme know if you need anything else, but am otherwise considering this complete :)

Thanks again for the encouragement!

EDIT: I pushed those changes to generateLink as well (mentioned in code review comment)

@utarwyn utarwyn added the skip-release Preserve the current version when merged label Oct 13, 2024
@utarwyn utarwyn merged commit 5583284 into utarwyn:main Oct 13, 2024
@patcon patcon deleted the 9-better-support-subpaths branch October 14, 2024 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working patch Increment the patch version when merged skip-release Preserve the current version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Almost working: allow/document how to use this when root storybook hosted at path
2 participants