Test relative assets for storybook (#1219)

This commit is contained in:
Evan Simkowitz 2024-11-06 11:56:49 -08:00 committed by GitHub
parent 437e4e8c6e
commit ed8d3c179c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 8 deletions

View File

@ -41,7 +41,7 @@ jobs:
working-directory: docs/
- name: Build Storybook
run: IS_OFFICIAL=1 yarn build-storybook
run: yarn build-storybook
# Copy the storybook static site into the docsite output and copy the assets from the main repo into the assets dir of the docsite output.
# It needs to be in assets/assets because assets/ gets served from the / root of the site and storybook expects to find assets in /assets/
- name: Copy Storybook to docs

View File

@ -40,15 +40,13 @@ const config: StorybookConfig = {
staticDirs: [{ from: "../assets", to: "/assets" }],
managerHead: (head) => `
${head}
<link rel="shortcut icon" href="/assets/waveterm-logo-with-bg.ico" />
<link rel="icon" type="image/png" href="/assets/waveterm-logo-with-bg.png" sizes="250x250" />
<link rel="shortcut icon" href="./assets/waveterm-logo-with-bg.ico" />
<link rel="icon" type="image/png" href="./assets/waveterm-logo-with-bg.png" sizes="250x250" />
<style>
.sidebar-header img {
max-width: 150px !important;
max-height: 100px !important;
}
</style>
<base href="${process.env.IS_OFFICIAL ? "/storybook" : "/"}" />
`,
</style>`,
};
export default config;

View File

@ -4,7 +4,7 @@ export const light = create({
base: "light",
brandTitle: "Wave Terminal Storybook",
brandUrl: "https://docs.waveterm.dev/storybook/",
brandImage: "/assets/wave-light.png",
brandImage: "./assets/wave-light.png",
brandTarget: "_self",
});
@ -12,6 +12,6 @@ export const dark = create({
base: "dark",
brandTitle: "Wave Terminal Storybook",
brandUrl: "https://docs.waveterm.dev/storybook/",
brandImage: "/assets/wave-dark.png",
brandImage: "./assets/wave-dark.png",
brandTarget: "_self",
});