From f4d0f793ac026e3c53ac41f74ecef272c80baa46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?William=20Herg=C3=A8s?= Date: Mon, 27 Oct 2025 21:03:05 +0100 Subject: fix(frontend): HTMX was handling rss links --- frontend/index.ts | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'frontend') diff --git a/frontend/index.ts b/frontend/index.ts index 61215cf..b970e5f 100644 --- a/frontend/index.ts +++ b/frontend/index.ts @@ -6,9 +6,17 @@ function setupAnchors() { document.querySelectorAll("a").forEach((e) => { // stuff related to external links are already handled in the backend if (!e.href.startsWith(window.location.origin) && /https?:\/\//.test(e.href)) return; + // stuff related to RSS must not be processed by HTMX. + if (e.href.endsWith("/rss/") || e.href.endsWith("/rss")) { + e.target = "_blank"; + return; + } + if (e.href == window.location.href) e.classList.add("target"); else e.classList.remove("target"); + if (e.hasAttribute("hx-trigger")) return; + e.setAttribute("hx-get", e.href); e.setAttribute("hx-trigger", "click"); e.setAttribute("hx-target", "#content"); -- cgit v1.2.3