Skip to content

Commit 6584c35

Browse files
committed
chore(storybook): inject base URL redirect into manager head
1 parent 443e9f2 commit 6584c35

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.storybook/manager-head.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!-- this file redirects `/` to the introduction story when using `bunx serve` -->
2+
<script>
3+
(function () {
4+
try {
5+
const u = new URL(window.location.href);
6+
if (!u.searchParams.get("path")) {
7+
// NB: this path must match an actual story ID
8+
u.search = "?path=/docs/introduction--docs";
9+
window.location.replace(u.toString());
10+
}
11+
} catch (e) {
12+
/* noop */
13+
}
14+
})();
15+
</script>

0 commit comments

Comments
 (0)