File tree Expand file tree Collapse file tree 4 files changed +51
-4
lines changed Expand file tree Collapse file tree 4 files changed +51
-4
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,9 @@ hide_title: true
18
18
/>
19
19
</h2 >
20
20
<p >
21
- <a href = " ./studio" >Stately Studio</a > is a suite of tools for visualizing
22
- and collaborating on your application logic, powered by XState.
21
+ <a href = " ./docs/studio" >Stately Studio</a > is a suite of tools for
22
+ visualizing and collaborating on your application logic, powered by
23
+ XState.
23
24
</p >
24
25
</div >
25
26
<div class = " docs-intro-xstate" >
@@ -33,8 +34,8 @@ hide_title: true
33
34
/>
34
35
</h2 >
35
36
<p >
36
- <a href = " ./xstate" >XState</a > is a best-in-class open source library for
37
- orchestrating and managing state in JavaScript and TypeScript apps.
37
+ <a href = " ./docs/ xstate" >XState</a > is a best-in-class open source library
38
+ for orchestrating and managing state in JavaScript and TypeScript apps.
38
39
</p >
39
40
</div >
40
41
</div >
Original file line number Diff line number Diff line change @@ -105,6 +105,36 @@ const config = {
105
105
] ,
106
106
] ,
107
107
108
+ plugins : [
109
+ [
110
+ '@docusaurus/plugin-client-redirects' ,
111
+ {
112
+ // Unbreak specific pages we know are broken where the structure changed between XState v4 and v5
113
+ redirects : [
114
+ {
115
+ to : '/docs/xstate-v4/xstate/model-based-testing/intro' ,
116
+ from : '/docs/category/xstate-model-based-testing' ,
117
+ } ,
118
+ {
119
+ to : '/docs/xstate-v4/xstate/actors/parent-child-communication' ,
120
+ from : '/docs/xstate/actors/parent-child-communication' ,
121
+ } ,
122
+ {
123
+ to : '/docs/xstate-v4/xstate/typescript/type-helpers' ,
124
+ from : '/docs/xstate/typescript/type-helpers' ,
125
+ } ,
126
+ ] ,
127
+ createRedirects ( existingPath ) {
128
+ if ( existingPath . includes ( '/docs' ) ) {
129
+ // Redirect everything from /docs/xstate-v5 to /docs (to unbreak Google search results)
130
+ return [ existingPath . replace ( '/docs' , '/docs/xstate-v5' ) ] ;
131
+ }
132
+ return undefined ; // Return a falsy value: no redirect created
133
+ } ,
134
+ } ,
135
+ ] ,
136
+ ] ,
137
+
108
138
themeConfig :
109
139
/** @type {import('@docusaurus/preset-classic').ThemeConfig } */
110
140
( {
Original file line number Diff line number Diff line change 28
28
},
29
29
"dependencies" : {
30
30
"@docusaurus/core" : " ^2.4.3" ,
31
+ "@docusaurus/plugin-client-redirects" : " ^2.4.3" ,
31
32
"@docusaurus/preset-classic" : " ^2.4.3" ,
32
33
"@docusaurus/remark-plugin-npm2yarn" : " ^2.4.3" ,
33
34
"@mdx-js/react" : " ^1.6.22" ,
Original file line number Diff line number Diff line change 1484
1484
react-helmet-async "*"
1485
1485
react-loadable "npm:@docusaurus/[email protected] "
1486
1486
1487
+ " @docusaurus/plugin-client-redirects@^2.4.3 " :
1488
+ version "2.4.3"
1489
+ resolved "https://registry.yarnpkg.com/@docusaurus/plugin-client-redirects/-/plugin-client-redirects-2.4.3.tgz#0da7e6facadbca3bd7cb8d0453f21bea7f4f1721"
1490
+ integrity sha512-iCwc/zH8X6eNtLYdyUJFY6+GbsbRgMgvAC/TmSmCYTmwnoN5Y1Bc5OwUkdtoch0XKizotJMRAmGIAhP8sAetdQ==
1491
+ dependencies :
1492
+ " @docusaurus/core" " 2.4.3"
1493
+ " @docusaurus/logger" " 2.4.3"
1494
+ " @docusaurus/utils" " 2.4.3"
1495
+ " @docusaurus/utils-common" " 2.4.3"
1496
+ " @docusaurus/utils-validation" " 2.4.3"
1497
+ eta "^2.0.0"
1498
+ fs-extra "^10.1.0"
1499
+ lodash "^4.17.21"
1500
+ tslib "^2.4.0"
1501
+
1487
1502
1488
1503
version "2.4.3"
1489
1504
resolved "https://registry.yarnpkg.com/@docusaurus/plugin-content-blog/-/plugin-content-blog-2.4.3.tgz#6473b974acab98e967414d8bbb0d37e0cedcea14"
You can’t perform that action at this time.
0 commit comments