File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -136,15 +136,23 @@ function BasicLayout({
136136 * such as edit in github and so on.
137137 */
138138 const renderPageHeader = ( ) => {
139- const curMenuSource = menuSource . filter ( r => pathname . indexOf ( r . title ) > - 1 )
139+ console . log ( 'routeData' , routeData )
140+ console . log ( 'menuSource' , menuSource )
141+ const curMenuSource = routeData . filter ( r => {
142+ if ( r . props . type === 'directory' ) return false
143+ return pathname . indexOf ( r . mdconf . abbrlink ) > - 1 || decodeURIComponent ( pathname ) . indexOf ( r . path ) > - 1
144+ } )
140145 const editPathName = curMenuSource [ 0 ] && curMenuSource [ 0 ] . path
146+ console . log ( 'curMenuSource' , curMenuSource )
147+ console . log ( 'a link' , `https://github.com/${ user } /${ repo
148+ } /edit/${ branch } ${ editPathName } .md`)
141149 return (
142150 < div className = { cx ( styles . pageHeader ) } >
143151 { user && repo ? (
144152 < a
145153 href = { `https://github.com/${ user } /${
146154 repo
147- } /edit/${ branch } ${ editPathName } `}
155+ } /edit/${ branch } ${ editPathName } .md `}
148156 target = "_blank"
149157 >
150158 < Icon className = { cx ( styles . icon ) } type = "edit" size = { 13 } />
You can’t perform that action at this time.
0 commit comments