File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ abbrlink: 179nqpxt
88
99### 1.5.0
1010
11- ` 2021-10-12 `
11+ ` 2021-10-13 `
1212
1313- ** Feature**
1414
Original file line number Diff line number Diff line change @@ -210,6 +210,10 @@ function BasicLayout({
210210
211211 const carryRepoInProd = ifProd && repo
212212 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'
213217 return (
214218 < div
215219 className = { cx ( `${ styles . content } ` , {
@@ -218,7 +222,7 @@ function BasicLayout({
218222 >
219223 < Switch >
220224 { /* 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 } ` } />
222226 { routeData . map ( ( item ) => {
223227 const { path, mdconf, component } = item
224228 const { abbrlink } = mdconf
You can’t perform that action at this time.
0 commit comments