Skip to content

Commit 79a4d17

Browse files
committed
Add page-specific Report Issue functionality
JavaScript dynamically updates the Report Issue footer link to include: - Current page URL (pre-filled in issue body) - Page title (pre-filled in issue title as "[Docs] Page Title") - Documentation label automatically applied This makes it much easier to report documentation issues since users don't need to manually copy/paste the page URL. Underworld development team with AI support from Claude Code
1 parent 864e735 commit 79a4d17

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

docs/_static/report-issue.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* Make the "Report Issue" footer link page-specific
3+
*
4+
* This script finds the Report Issue link and updates it to include
5+
* the current page URL and title as query parameters for GitHub Issues.
6+
*/
7+
document.addEventListener('DOMContentLoaded', function() {
8+
// Find the Report Issue link in the footer using aria-label
9+
const reportLink = document.querySelector('a[aria-label="Report Issue"]');
10+
11+
if (reportLink) {
12+
// Get current page info
13+
const pageUrl = window.location.href;
14+
const pageTitle = document.title.split(' — ')[0] || document.title;
15+
16+
// Build the issue URL with pre-filled information
17+
const baseUrl = 'https://github.com/underworldcode/underworld3/issues/new';
18+
const params = new URLSearchParams({
19+
'template': 'docs-issue.md',
20+
'labels': 'documentation',
21+
'title': '[Docs] ' + pageTitle,
22+
'body': '## Page URL\n' + pageUrl + '\n\n## Description\n<!-- Describe the problem or suggested improvement -->\n\n'
23+
});
24+
25+
reportLink.href = baseUrl + '?' + params.toString();
26+
}
27+
});

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
html_theme = 'furo'
8787
html_static_path = ['_static']
8888
html_css_files = ['custom.css'] # Custom styling (smaller headings)
89+
html_js_files = ['report-issue.js'] # Page-specific issue reporting
8990
html_extra_path = ['media'] # Copy media folder (including pyvista HTML embeds) to build root
9091
html_title = "Underworld3"
9192
html_logo = "assets/MansoursNightmare.png"

0 commit comments

Comments
 (0)