-
- {{ with .File }}
- {{ $githubRepo := "validatedpatterns/docs" }}
- {{ $githubBranch := "main" }}
- {{ $githubFilePath := .Path }}
-
-
-
-
-
- {{ end }}
-
-
-
-
{{- .TableOfContents | replaceRE "
" "" | replaceRE "- " "
- " | replaceRE "
-
diff --git a/layouts/patterns/single.html b/layouts/patterns/single.html
index 2781c5bee..1b637936e 100644
--- a/layouts/patterns/single.html
+++ b/layouts/patterns/single.html
@@ -10,6 +10,33 @@
{{ .Content }}
+
+
+ {{ partial "page-navigation.html" . }}
+
+
+
{{ partial "toc.html" . }}
diff --git a/static/css/custom.css b/static/css/custom.css
index 05d44d711..4eca65c8f 100644
--- a/static/css/custom.css
+++ b/static/css/custom.css
@@ -50,6 +50,19 @@ h3 {
margin-bottom: 1rem;
}
+/* Page Navigation Styles */
+.page-nav-card {
+ border: 1px solid #d2d2d2;
+ border-radius: 3px;
+ height: auto;
+ min-height: 80px;
+ cursor: pointer;
+}
+
+.page-nav-chevron {
+ color: #6a6e73;
+}
+
/*CODE BLOCKS */
code {
diff --git a/static/js/select-report-issue-hover.js b/static/js/select-report-issue-hover.js
deleted file mode 100644
index 20f6c6469..000000000
--- a/static/js/select-report-issue-hover.js
+++ /dev/null
@@ -1,125 +0,0 @@
-// static/js/select-report-issue-hover.js
-
-let reportButton = null;
-let buttonTimeout = null;
-
-const BUTTON_FADE_DURATION_MS = 6000; // Button disappears after 4 seconds
-
-function removeReportButton() { //
- if (reportButton && reportButton.parentNode) {
- reportButton.parentNode.removeChild(reportButton);
- reportButton = null;
- }
- if (buttonTimeout) {
- clearTimeout(buttonTimeout);
- buttonTimeout = null;
- }
-}
-
-function showReportButton(x, y, selectedText) {
- removeReportButton();
-
- reportButton = document.createElement('button');
- reportButton.id = 'bug-report-button';
- reportButton.className = 'bug-report-button';
- reportButton.innerHTML = 'Report Bug
'; // Changed to fa-solid based on your HTML
-
- // Set position to fixed and max z-index (still good practice)
- reportButton.style.position = 'fixed';
- reportButton.style.left = `${x}px`;
- reportButton.style.top = `${y - 40}px`; // Adjust Y to place it above selection
- reportButton.style.zIndex = '2147483647'; // Highest possible z-index
-
- // Store selected text and other context data on the button
- reportButton.dataset.selectedText = selectedText;
- reportButton.dataset.currentPageUrl = window.location.href;
- reportButton.dataset.githubFilePath = getGitHubFilePath();
-
- // DO NOT attach a click listener directly to the button here.
- // The click will be handled by the document listener below.
-
- document.documentElement.appendChild(reportButton); // Append to HTML element for broadest context
-
- // Start timeout to remove button if not clicked
- buttonTimeout = setTimeout(removeReportButton, BUTTON_FADE_DURATION_MS);
-}
-
-function getGitHubFilePath() {
- const bodyElement = document.querySelector('body');
- if (bodyElement && bodyElement.dataset.githubFile) {
- const repoBaseUrl = 'https://github.com/validatedpatterns/docs/blob/main/';
- return repoBaseUrl + bodyElement.dataset.githubFile;
- }
- return "Could not determine source file automatically. Please specify if known.";
-}
-
-// --- NEW EVENT DELEGATION LOGIC ---
-
-// Listen for clicks on the entire document (or document.body)
-// This listener WILL always fire, even if an overlay is present.
-document.addEventListener('mouseup', function(event) { // <-- SET BREAKPOINT HERE (Around line 61 in the full code)
- const selectedText = window.getSelection().toString().trim(); // <--- ALSO SET A BREAKPOINT ON THIS LINE
- // ...
-});
- // If a reportButton exists AND the click target is that button (or a child of it, like the icon)
- // This uses `contains` to check if the click was *inside* the button's DOM subtree.
- if (reportButton && reportButton.contains(event.target)) {
- event.preventDefault(); // Prevent any default behavior (like text selection or link following)
- event.stopPropagation(); // Stop the event from bubbling up further
-
- console.log('BUG REPORT BUTTON CLICKED (via event delegation)!'); // For debugging
-
- // Retrieve data from the button's dataset
- const text = reportButton.dataset.selectedText;
- const currentPageUrl = reportButton.dataset.currentPageUrl;
- const githubFilePath = reportButton.dataset.githubFilePath;
-
- const issueTitle = `Bug Report: Issue on "${text.substring(0, 50).replace(/\n/g, ' ')}..."`;
- let issueBody = `
-**Description of the issue:**
-\`\`\`
-${text}
-\`\`\`
-
----
-**Context:**
-- **Page URL:** ${currentPageUrl}
-- **GitHub Source File:** ${githubFilePath}
- `;
-
- const encodedTitle = encodeURIComponent(issueTitle);
- const encodedBody = encodeURIComponent(issueBody);
-
- const githubRepo = 'validatedpatterns/docs'; // Your GitHub repository
- const githubIssueUrl = `https://github.com/${githubRepo}/issues/new?title=${encodedTitle}&body=${encodedBody}`;
-
- window.open(githubIssueUrl, '_blank');
- removeReportButton(); // Remove button after opening issue
- } else {
- // If the button exists but the click was NOT on it, remove it (equivalent to mousedown logic)
- removeReportButton();
- }
-});
-
-// Original mouseup listener (remains the same)
-document.addEventListener('mouseup', function(event) {
- const selectedText = window.getSelection().toString().trim();
-
- if (selectedText.length > 0) {//
- const selection = window.getSelection(); //
- if (selection.rangeCount > 0) { //
- const range = selection.getRangeAt(0);
- const rect = range.getBoundingClientRect();
-
- const x = rect.left + window.scrollX + (rect.width / 2) - 50;
- const y = rect.top + window.scrollY;
-
- showReportButton(x, y, selectedText); //
- }
- } else {
- removeReportButton(); //
- }
-});
-
-// The previous mousedown listener is now essentially replaced by the first part of the new 'click' listener.
-// You can remove the old document.addEventListener('mousedown', ...) function if you still have it.
\ No newline at end of file
diff --git a/static/js/select-report-issue-popup.js b/static/js/select-report-issue-popup.js
deleted file mode 100644
index 7f3317829..000000000
--- a/static/js/select-report-issue-popup.js
+++ /dev/null
@@ -1,112 +0,0 @@
-// static/js/select-report-issue.js (or wherever you prefer to store static assets)
-
-document.addEventListener('mouseup', function() {
- const selectedText = window.getSelection().toString().trim();
-
- if (selectedText.length > 0) {
- // You might want to add a small button or popup here instead of direct confirmation
- // For simplicity, we'll keep the confirmation for now.
-
- const currentPageUrl = window.location.href;
- const githubFilePath = getGitHubFilePath(); // This will now be more accurate for Hugo
-
- const issueTitle = `Bug Report: Issue on "${selectedText.substring(0, 50).replace(/\n/g, ' ')}..."`;
- let issueBody = `
-**Description of the issue:**
-\`\`\`
-${selectedText}
-\`\`\`
-
----
-**Context:**
-- **Page URL:** ${currentPageUrl}
-- **GitHub Source File:** ${githubFilePath}
- `;
-
- const encodedTitle = encodeURIComponent(issueTitle);
- const encodedBody = encodeURIComponent(issueBody);
-
- const githubRepo = 'validatedpatterns/docs'; // Your GitHub repository
- const githubIssueUrl = `https://github.com/${githubRepo}/issues/new?title=${encodedTitle}&body=${encodedBody}`;
-
- const confirmation = confirm("Do you want to create an issue on GitHub for the selected text?");
- if (confirmation) {
- window.open(githubIssueUrl, '_blank');
- }
- }
-});
-
-
-// Hugo-specific function to get the GitHub file path
-function getGitHubFilePath() {
- // This assumes you've added a data-github-file attribute to your body or a container.
- const bodyElement = document.querySelector('body');
- if (bodyElement && bodyElement.dataset.githubFile) {
- // Construct the full GitHub blob URL
- // Assuming your source files are in the 'content' directory of your repo
- // And you're using the 'main' branch
- const repoBaseUrl = 'https://github.com/validatedpatterns/docs/blob/main/';
- return repoBaseUrl + bodyElement.dataset.githubFile;
- }
-
- // Fallback if the data attribute isn't found (shouldn't happen with Hugo setup)
- return "Could not determine source file automatically. Please specify if known.";
-}
-
-
-// --- Introducing DOMContentLoaded for the Jira Button Logic ---
-document.addEventListener('DOMContentLoaded', function() {
- // Select the Jira bug button using its NEW ID
- const jiraBugButton = document.getElementById('report-doc-bug-btn'); // <--- CHANGED THIS LINE
-
- if (jiraBugButton) {
- console.log("Jira bug button found!", jiraBugButton); // For debugging: confirm it's found
- jiraBugButton.removeAttribute('href'); // Remove the original href
-
- jiraBugButton.addEventListener('click', function(event) {
- event.preventDefault();
- event.stopPropagation();
-
- let selectedText = window.getSelection().toString().trim();
- if (selectedText.length === 0) {
- selectedText = "No specific text was selected. Reporting a general page issue.";
- }
-
- const currentPageUrl = window.location.href;
- const githubFilePath = getGitHubFilePath();
-
- const issueTitle = `Documentation Bug Report: ${selectedText.substring(0, 70).replace(/\n/g, ' ')}...`;
- let issueBody = `
-**Issue Description:**
-\`\`\`
-${selectedText}
-\`\`\`
-
----
-**Context:**
-- **Page URL:** ${currentPageUrl}
-- **GitHub Source File:** ${githubFilePath}
- `;
-
- const encodedTitle = encodeURIComponent(issueTitle);
- const encodedBody = encodeURIComponent(issueBody);
-
- const githubRepo = 'validatedpatterns/docs';
- const githubIssueUrl = `https://github.com/${githubRepo}/issues/new?title=${encodedTitle}&body=${encodedBody}`;
-
- const confirmation = confirm("Do you want to report this as a documentation bug on GitHub?");
- if (confirmation) {
- window.open(githubIssueUrl, '_blank');
- }
- });
- } else {
- // This warning will now be more accurate if the ID is truly missing/typo'd
- console.warn("Jira bug button (ID: 'report-doc-bug-btn') not found.");
- }
-
- // --- Cleanup for previous button (keep this) ---
- const existingFloatingButton = document.getElementById('bug-report-button');
- if (existingFloatingButton) {
- existingFloatingButton.parentNode.removeChild(existingFloatingButton);
- }
-});
\ No newline at end of file