commit 108cbea0ec6188c08e093d02bd9d48e17bbe990a
parent d39d656a4bccbfb736a93cc8b420a92caa6e79d9
Author: Damian Myrda <damian@prime8.dev>
Date: Thu, 22 Oct 2026 01:28:38 +0000
web: links inside project content link out normally
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/internal/web/scripts/modules/header.js b/internal/web/scripts/modules/header.js
@@ -17,6 +17,8 @@ const APP_PATH = /^\/(?:(?:projects|experience)(?:\/[^/]+)?)?\/?$/;
// it should be left to the browser.
function appPath(a) {
if (a.hasAttribute("download") || a.hasAttribute("hx-get")) return "";
+ // links written into content (project READMEs and details) link out as written
+ if (a.target === "_blank" || a.closest("#project-detail, .readme-content")) return "";
let url;
try {
url = new URL(a.href, window.location.href);
@@ -59,8 +61,8 @@ export function initHeader() {
link.click();
}
- // Every link into the app (relative, or absolute to prime8.dev, even with
- // target=_blank) swaps #content instead of reloading the page. Modified
+ // Every app link (relative, or absolute to prime8.dev) outside project
+ // content swaps #content instead of reloading the page. Modified
// clicks (new tab, new window) are left alone.
function navigate(path) {
const tab = path === "/" ? fallback : path.slice(1).split("/")[0];