diff options
| author | William Hergès <william@herges.fr> | 2025-10-27 21:03:05 +0100 |
|---|---|---|
| committer | William Hergès <william@herges.fr> | 2025-10-27 21:03:05 +0100 |
| commit | f4d0f793ac026e3c53ac41f74ecef272c80baa46 (patch) | |
| tree | cb676954357afc1779bcbb2d5c5e14a36d7a411c /frontend/index.ts | |
| parent | 91d997f62564559298944d371d3e5b31df055da9 (diff) | |
fix(frontend): HTMX was handling rss links
Diffstat (limited to 'frontend/index.ts')
| -rw-r--r-- | frontend/index.ts | 8 |
1 files changed, 8 insertions, 0 deletions
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"); |
