diff --git a/docs/index.html b/docs/index.html index 3aaaecf4..0349f74c 100644 --- a/docs/index.html +++ b/docs/index.html @@ -375,6 +375,8 @@ overflow-wrap: anywhere; } + + .plugin-slug { color: var(--muted); font-size: 0.86rem; @@ -879,6 +881,7 @@

ArchiveBox Plugin Gallery

@@ -1120,6 +1123,7 @@

Config Options

@@ -1318,6 +1322,7 @@

Config Options

@@ -1501,6 +1506,7 @@

Config Options

@@ -1689,6 +1695,7 @@

Config Options

@@ -1919,6 +1926,7 @@

Config Options

@@ -2052,6 +2060,7 @@

Config Options

@@ -2185,6 +2194,7 @@

Config Options

@@ -2317,6 +2327,7 @@

Config Options

@@ -2443,6 +2454,7 @@

Config Options

@@ -2569,6 +2581,7 @@

Config Options

@@ -2695,6 +2708,7 @@

Config Options

@@ -2827,6 +2841,7 @@

Config Options

@@ -2953,6 +2968,7 @@

Config Options

@@ -3091,6 +3107,7 @@

Config Options

@@ -3217,6 +3234,7 @@

Config Options

@@ -3647,6 +3665,7 @@

Config Options

@@ -3772,6 +3791,7 @@

Config Options

@@ -3897,6 +3917,7 @@

Config Options

@@ -4068,6 +4089,7 @@

Config Options

@@ -4261,6 +4283,7 @@

Config Options

@@ -4511,6 +4534,7 @@

Config Options

@@ -4649,6 +4673,7 @@

Config Options

@@ -4787,6 +4812,7 @@

Config Options

@@ -4913,6 +4939,7 @@

Config Options

@@ -5038,6 +5065,7 @@

Config Options

@@ -5210,6 +5238,7 @@

Config Options

@@ -5380,6 +5409,7 @@

Config Options

@@ -5552,6 +5582,7 @@

Config Options

@@ -5711,6 +5742,7 @@

Config Options

@@ -5832,6 +5864,7 @@

Config Options

@@ -6049,6 +6082,7 @@

Config Options

@@ -6244,6 +6278,7 @@

Config Options

@@ -6420,6 +6455,7 @@

Config Options

@@ -6593,6 +6629,7 @@

Config Options

@@ -6703,6 +6740,7 @@

Config Options

@@ -6813,6 +6851,7 @@

Config Options

@@ -6923,6 +6962,7 @@

Config Options

@@ -7033,6 +7073,7 @@

Config Options

@@ -7143,6 +7184,7 @@

Config Options

@@ -7398,6 +7441,7 @@

Config Options

@@ -7544,6 +7588,7 @@

Config Options

@@ -7703,6 +7748,7 @@

Config Options

@@ -7824,6 +7870,7 @@

Config Options

@@ -7938,6 +7985,7 @@

Config Options

@@ -8103,6 +8151,7 @@

Config Options

@@ -8249,6 +8298,7 @@

Config Options

@@ -8363,6 +8413,7 @@

Config Options

@@ -8475,6 +8526,7 @@

Config Options

@@ -8587,6 +8639,7 @@

Config Options

@@ -8765,6 +8818,7 @@

Config Options

@@ -8865,6 +8919,7 @@

Config Options

@@ -8964,6 +9019,7 @@

Config Options

@@ -9063,6 +9119,7 @@

Config Options

@@ -9157,6 +9214,7 @@

Config Options

@@ -9251,6 +9309,7 @@

Config Options

@@ -9321,6 +9380,7 @@

Config Options

@@ -9584,7 +9644,7 @@

Community and social

@@ -9610,7 +9670,36 @@

Community and social

emptyState.hidden = count !== 0; }; - searchInput.addEventListener("input", applyFilter); + const setHash = (value) => { + const clean = value.replace(/^#/, "").trim(); + if (clean) { + history.replaceState(null, "", "#" + clean); + } else { + history.replaceState(null, "", location.pathname + location.search); + } + }; + + const navigateToHash = () => { + const hash = decodeURIComponent(location.hash.replace(/^#/, "")).trim(); + if (!hash) return; + + const target = document.getElementById(hash); + if (target && target.classList.contains("plugin-card")) { + searchInput.value = ""; + applyFilter(); + target.open = true; + target.scrollIntoView({ behavior: "smooth", block: "start" }); + } else { + searchInput.value = hash; + applyFilter(); + searchInput.focus(); + } + }; + + searchInput.addEventListener("input", () => { + applyFilter(); + setHash(searchInput.value.trim()); + }); for (const card of cards) { card.addEventListener("click", (event) => { @@ -9618,9 +9707,17 @@

Community and social

if (event.target.closest(interactiveSelector)) return; card.open = true; }); + + card.addEventListener("toggle", () => { + if (card.open) { + setHash(card.id); + } + }); } applyFilter(); + navigateToHash(); + window.addEventListener("hashchange", navigateToHash); \ No newline at end of file diff --git a/docs/index.html.j2 b/docs/index.html.j2 index 72980740..ac3f0379 100644 --- a/docs/index.html.j2 +++ b/docs/index.html.j2 @@ -375,6 +375,8 @@ overflow-wrap: anywhere; } + + .plugin-slug { color: var(--muted); font-size: 0.86rem; @@ -880,6 +882,7 @@
{% for plugin in site.plugins %}
@@ -1299,7 +1302,36 @@ emptyState.hidden = count !== 0; }; - searchInput.addEventListener("input", applyFilter); + const setHash = (value) => { + const clean = value.replace(/^#/, "").trim(); + if (clean) { + history.replaceState(null, "", "#" + clean); + } else { + history.replaceState(null, "", location.pathname + location.search); + } + }; + + const navigateToHash = () => { + const hash = decodeURIComponent(location.hash.replace(/^#/, "")).trim(); + if (!hash) return; + + const target = document.getElementById(hash); + if (target && target.classList.contains("plugin-card")) { + searchInput.value = ""; + applyFilter(); + target.open = true; + target.scrollIntoView({ behavior: "smooth", block: "start" }); + } else { + searchInput.value = hash; + applyFilter(); + searchInput.focus(); + } + }; + + searchInput.addEventListener("input", () => { + applyFilter(); + setHash(searchInput.value.trim()); + }); for (const card of cards) { card.addEventListener("click", (event) => { @@ -1307,9 +1339,17 @@ if (event.target.closest(interactiveSelector)) return; card.open = true; }); + + card.addEventListener("toggle", () => { + if (card.open) { + setHash(card.id); + } + }); } applyFilter(); + navigateToHash(); + window.addEventListener("hashchange", navigateToHash);