File tree Expand file tree Collapse file tree 3 files changed +18
-14
lines changed
scripts/storybook/src/scripts Expand file tree Collapse file tree 3 files changed +18
-14
lines changed Original file line number Diff line number Diff line change 4
4
"private" : true ,
5
5
"description" : " Fluent UI React v9 documentation" ,
6
6
"scripts" : {
7
- "build-storybook" : " cross-env NODE_OPTIONS=--max_old_space_size=3072 DEPLOY_PATH=/react/ storybook build -o ./dist/react --docs" ,
8
- "postbuild-storybook" : " yarn rewrite-title" ,
7
+ "build-storybook" : " cross-env NODE_OPTIONS=--max_old_space_size=3072 storybook build -o ./dist/react --docs" ,
8
+ "postbuild-storybook" : " yarn rewrite-title && yarn inject-redirect " ,
9
9
"rewrite-title" : " node -r ../../scripts/ts-node/src/register ../../scripts/storybook/src/scripts/rewrite-title.ts --title 'Fluent UI React v9' --distPath ./dist/react" ,
10
- "inject-redirect" : " node -r ../../scripts/ts-node/src/register ../../scripts/storybook/src/scripts/inject-redirect.ts --distPath ./dist/ --redirectUrl https://mainframev.github.io/fluentui/react" ,
10
+ "inject-redirect" : " node -r ../../scripts/ts-node/src/register ../../scripts/storybook/src/scripts/inject-redirect.ts --distPath ./dist/ --redirectUrl https://mainframev.github.io/fluentui/react/index.html " ,
11
11
"generate-llms-docs" : " yarn storybook-llms-extractor --config storybook-llms.config.js" ,
12
12
"clean" : " just-scripts clean" ,
13
13
"code-style" : " just-scripts code-style" ,
Original file line number Diff line number Diff line change 9
9
"executor" : " nx:noop" ,
10
10
"dependsOn" : [
11
11
" build-storybook" ,
12
- " inject-redirect" ,
13
12
{
14
13
"projects" : [" chart-docsite" , " web-components" ],
15
14
"target" : " build-storybook:docsite"
Original file line number Diff line number Diff line change @@ -45,16 +45,21 @@ function processArgs(): { distPath: string; redirectUrl: string } {
45
45
46
46
function injectRedirect ( filePath : string , url : string ) {
47
47
const content = dedent `
48
- <!DOCTYPE html>
49
- <html>
50
- <head>
51
- <meta http-equiv="refresh" content="0; url=${ url } ">
52
- <title>Redirecting...</title>
53
- </head>
54
- <body>
55
- <p>The has moved to <a href="${ url } ">${ url } </a>. You will be automatically redirected.</p>
56
- </body>
57
- </html>
48
+ <!DOCTYPE html>
49
+ <html>
50
+ <head>
51
+ <meta charset="UTF-8">
52
+ <title>Redirecting...</title>
53
+ <script>
54
+ var target = "${ url } " + window.location.search + window.location.hash;
55
+ window.location.replace(target);
56
+ </script>
57
+ </head>
58
+ <body>
59
+ <p>The page has moved to <a id="redirectLink" href="${ url } ">${ url } </a>.
60
+ You will be automatically redirected.</p>
61
+ </body>
62
+ </html>
58
63
` ;
59
64
60
65
writeFileSync ( filePath , content , 'utf-8' ) ;
You can’t perform that action at this time.
0 commit comments