File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ export default defineConfig({
25
25
return {
26
26
params : {
27
27
organization : repoData ?. organization ,
28
+ repository : repoData ?. repository ,
28
29
}
29
30
}
30
31
@@ -156,8 +157,23 @@ export default defineConfig({
156
157
157
158
const relativePath = pageData . relativePath
158
159
const organization = pageData . params ?. organization ;
160
+ const repository = pageData . params ?. repository ;
161
+
162
+ // If we have repository info from params, use it directly
163
+ if ( organization && repository ) {
164
+ const [ _ , ...rest ] = relativePath . split ( '/' )
165
+ const restPath = rest . join ( '/' )
166
+
167
+ if ( relativePath . startsWith ( 'api/' ) ) {
168
+ return `https://github.com/${ organization } /${ repository } /edit/master/docs/api/${ restPath } `
169
+ }
170
+
171
+ if ( relativePath . startsWith ( 'products/' ) ) {
172
+ return `https://github.com/${ organization } /${ repository } /edit/master/docs/product/${ restPath } `
173
+ }
174
+ }
159
175
160
- // Common calculation for repo extraction from relativePath
176
+ // Fallback to old logic for paths that don't have repo info
161
177
const [ _ , repoName , ...rest ] = relativePath . split ( '/' )
162
178
const repoNamePath = repoName ?. replace ( / \d + - / g, '' ) || ''
163
179
const restPath = rest . join ( '/' )
You can’t perform that action at this time.
0 commit comments