@@ -171,29 +171,31 @@ export default defineConfig({
171
171
text : 'Редактировать страницу' ,
172
172
pattern : ( pageData ) => {
173
173
174
- const relativePath = pageData . relativePath
174
+ const filePath = pageData . filePath
175
175
const organization = pageData . params ?. organization ;
176
176
const repository = pageData . params ?. repository ;
177
177
178
178
// If we have repository info from params, use it directly
179
179
if ( organization && repository ) {
180
- if ( relativePath . startsWith ( 'api/' ) ) {
180
+ if ( filePath . startsWith ( 'api/' ) ) {
181
181
// For API paths, remove 'api/' and repository name from path
182
- const [ _ , repoSegment , ...rest ] = relativePath . split ( '/' )
182
+ const [ _ , repoSegment , ...rest ] = filePath . split ( '/' )
183
183
const restPath = rest . join ( '/' )
184
184
return `https://github.com/${ organization } /${ repository } /edit/master/docs/api/${ restPath } ` ;
185
185
}
186
186
187
187
// For product pages - determine path based on repository type
188
- if ( repository === 'autumn' ) {
189
- // This is autumn documentation at root level - use entire relativePath
190
- const restPath = relativePath
191
- return `https://github.com/${ organization } /${ repository } /edit/master/docs/product/${ restPath } ` ;
192
- } else {
193
- // This is other repository documentation - path after first segment (repository name)
194
- const [ _ , ...rest ] = relativePath . split ( '/' )
195
- const restPath = rest . join ( '/' )
196
- return `https://github.com/${ organization } /${ repository } /edit/master/docs/product/${ restPath } ` ;
188
+ if ( filePath . startsWith ( 'products/' ) ) {
189
+ if ( repository === 'autumn' ) {
190
+ // For autumn documentation, use the relativePath since it's rewritten to remove products/autumn
191
+ const restPath = pageData . relativePath
192
+ return `https://github.com/${ organization } /${ repository } /edit/master/docs/product/${ restPath } ` ;
193
+ } else {
194
+ // For other repository documentation - path after repository segment
195
+ const [ _ , repoSegment , ...rest ] = filePath . split ( '/' )
196
+ const restPath = rest . join ( '/' )
197
+ return `https://github.com/${ organization } /${ repository } /edit/master/docs/product/${ restPath } ` ;
198
+ }
197
199
}
198
200
}
199
201
0 commit comments