File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ abbrlink: 179nqpxt
8
8
9
9
### 1.5.0
10
10
11
- ` 2021-10-12 `
11
+ ` 2021-10-13 `
12
12
13
13
- ** Feature**
14
14
Original file line number Diff line number Diff line change @@ -210,6 +210,10 @@ function BasicLayout({
210
210
211
211
const carryRepoInProd = ifProd && repo
212
212
const renderContent = ( ) => {
213
+ console . log ( 'routeData' , routeData )
214
+ const defaultPath = ( routeData . find ( data => data . path === '/README' )
215
+ && routeData . find ( data => data . path === '/README' ) . mdconf
216
+ && routeData . find ( data => data . path === '/README' ) . mdconf . abbrlink ) || 'README'
213
217
return (
214
218
< div
215
219
className = { cx ( `${ styles . content } ` , {
@@ -218,7 +222,7 @@ function BasicLayout({
218
222
>
219
223
< Switch >
220
224
{ /* see https://reacttraining.com/react-router/web/api/Redirect/exact-bool */ }
221
- < Redirect exact from = { ifAddPrefix ? `/${ repo } ` : `/` } to = { ifAddPrefix ? `/${ repo } /README ` : `/README ` } />
225
+ < Redirect exact from = { ifAddPrefix ? `/${ repo } ` : `/` } to = { ifAddPrefix ? `/${ repo } /${ defaultPath } ` : `/${ defaultPath } ` } />
222
226
{ routeData . map ( ( item ) => {
223
227
const { path, mdconf, component } = item
224
228
const { abbrlink } = mdconf
You can’t perform that action at this time.
0 commit comments