File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -41,16 +41,17 @@ const getAllPaths = async () => {
4141 ( locale = '' ) =>
4242 ( files = [ ] ) =>
4343 sourcePages . map ( filename => {
44- let path = filename . replace ( nextConstants . MD_EXTENSION_REGEX , '' ) ;
44+ // remove the index.md(x) suffix from a pathname
45+ let pathname = filename . replace ( nextConstants . MD_EXTENSION_REGEX , '' ) ;
4546 // remove trailing slash for correct Windows pathing of the index files
46- if ( path . length > 1 && path . endsWith ( sep ) ) {
47- path = path . substring ( 0 , path . length - 1 ) ;
47+ if ( pathname . length > 1 && pathname . endsWith ( sep ) ) {
48+ pathname = pathname . substring ( 0 , pathname . length - 1 ) ;
4849 }
4950 return {
50- pathname : normalize ( path ) ,
51+ pathname : normalize ( pathname ) ,
5152 filename : filename ,
5253 localised : files . includes ( filename ) ,
53- routeWithLocale : `${ locale } /${ path } ` ,
54+ routeWithLocale : `${ locale } /${ pathname } ` ,
5455 } ;
5556 } ) ;
5657
You can’t perform that action at this time.
0 commit comments