File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
doc/templates/uno/component Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -27,10 +27,25 @@ function renderAffix() {
2727 if ( contributionList . length > 0 ) {
2828 const pageUrl = encodeURIComponent ( window . location . href ) ;
2929 const issueTitle = encodeURIComponent ( `[Docs] Feedback: ${ document . title } ` ) ;
30- const issueUrl = `https://github.com/unoplatform/uno/issues/new?template=documentation-issue.yml&title=${ issueTitle } &docs-issue-location=${ pageUrl } ` ;
3130
32- // Add icon to "Edit this page"
31+ // Derive GitHub repository path from the "Edit this page" link when possible,
32+ // falling back to the main Uno repository for backward compatibility.
33+ let repoPath = 'unoplatform/uno' ;
34+
3335 const editLink = contributionList . find ( 'li a.contribution-link' ) ;
36+ if ( editLink . length > 0 ) {
37+ const editHref = editLink . attr ( 'href' ) ;
38+ if ( editHref ) {
39+ const repoMatch = editHref . match ( / g i t h u b \. c o m \/ ( [ ^ \/ ] + \/ [ ^ \/ ] + ) / i) ;
40+ if ( repoMatch && repoMatch [ 1 ] ) {
41+ repoPath = repoMatch [ 1 ] ;
42+ }
43+ }
44+ }
45+
46+ const issueUrl = `https://github.com/${ repoPath } /issues/new?template=documentation-issue.yml&title=${ issueTitle } &docs-issue-location=${ pageUrl } ` ;
47+
48+ // Add icon to "Edit this page"
3449 if ( editLink . length > 0 ) {
3550 editLink . prepend ( '<i class="fa fa-edit"></i> ' ) ;
3651 }
You can’t perform that action at this time.
0 commit comments