@@ -25,15 +25,14 @@ export default defineConfig({
25
25
// For API paths, repository name is in the second segment after rewrite
26
26
repoName = pageData . relativePath . split ( '/' ) [ 1 ] ?. replace ( / \d + - / g, '' ) || '' ;
27
27
} else {
28
- // Check if this is a root-level autumn path (after rewrite from products/autumn/)
29
- const firstSegment = pageData . relativePath . split ( '/' ) [ 0 ] ;
30
- const autumnRootDirs = [ 'getting-started' , 'framework-elements' ] ;
31
-
32
- if ( autumnRootDirs . includes ( firstSegment ) ) {
33
- // This is autumn documentation at root level
28
+ // Use filePath to determine if this is autumn documentation
29
+ // pageData.filePath contains the original path before rewrites
30
+ if ( pageData . filePath && pageData . filePath . includes ( 'products/000-autumn' ) ) {
31
+ // This is autumn documentation at root level (after rewrite from products/000-autumn/)
34
32
repoName = 'autumn' ;
35
33
} else {
36
34
// For other products, repository name is in the first segment after rewrite
35
+ const firstSegment = pageData . relativePath . split ( '/' ) [ 0 ] ;
37
36
repoName = firstSegment ?. replace ( / \d + - / g, '' ) || '' ;
38
37
}
39
38
}
@@ -186,11 +185,8 @@ export default defineConfig({
186
185
return `https://github.com/${ organization } /${ repository } /edit/master/docs/api/${ restPath } ` ;
187
186
}
188
187
189
- // For product pages
190
- const firstSegment = relativePath . split ( '/' ) [ 0 ] ;
191
- const autumnRootDirs = [ 'getting-started' , 'framework-elements' ] ;
192
-
193
- if ( autumnRootDirs . includes ( firstSegment ) ) {
188
+ // For product pages - use filePath to determine if it's autumn docs
189
+ if ( pageData . filePath && pageData . filePath . includes ( 'products/000-autumn' ) ) {
194
190
// This is autumn documentation at root level - path after first segment
195
191
const [ _ , ...rest ] = relativePath . split ( '/' )
196
192
const restPath = rest . join ( '/' )
0 commit comments