File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -266,6 +266,10 @@ const config: Config = {
266266 {
267267 // scope
268268 docsDir : "docs" ,
269+ // URLs: we use routeBasePath "/" so docs are at root, not /docs
270+ pathTransformation : {
271+ ignorePaths : [ "docs" ] ,
272+ } ,
269273 // outputs
270274 generateLLMsTxt : true ,
271275 generateLLMsFullTxt : true ,
Original file line number Diff line number Diff line change @@ -111,14 +111,17 @@ function buildReplacements() {
111111function fixFile ( filePath , replacements ) {
112112 let content = fs . readFileSync ( filePath , "utf8" ) ;
113113 let changed = false ;
114+ const rightUrlBase = `${ SITE_BASE } /` ;
114115 for ( const [ wrongPath , rightPath ] of replacements ) {
115- const wrongUrl = `${ SITE_BASE } /${ wrongPath } ` ;
116- const rightUrl = `${ SITE_BASE } /${ rightPath } ` ;
117- const re = new RegExp ( escapeRe ( wrongUrl ) + "(?!/)" , "g" ) ;
118- const next = content . replace ( re , rightUrl ) ;
119- if ( next !== content ) {
120- content = next ;
121- changed = true ;
116+ const rightUrl = rightUrlBase + rightPath ;
117+ for ( const prefix of [ "" , "docs/" ] ) {
118+ const wrongUrl = rightUrlBase + prefix + wrongPath ;
119+ const re = new RegExp ( escapeRe ( wrongUrl ) + "(?!/)" , "g" ) ;
120+ const next = content . replace ( re , rightUrl ) ;
121+ if ( next !== content ) {
122+ content = next ;
123+ changed = true ;
124+ }
122125 }
123126 }
124127 if ( changed ) {
You can’t perform that action at this time.
0 commit comments