diff --git a/src/pages/faq.astro b/src/pages/faq.astro index c839379..762e471 100644 --- a/src/pages/faq.astro +++ b/src/pages/faq.astro @@ -71,9 +71,10 @@ const structuredData = JSON.stringify({ faq.addEventListener("toggle", () => { const openFaqs = faqs.filter(f => f.open); if (openFaqs.length === 1) { - location.hash = openFaqs[0].dataset.faqTitle!; + const faqTitle = openFaqs[0].dataset.faqTitle!; + history.replaceState(undefined, "", `/faq#${faqTitle}`); } else { - location.hash = ""; + history.replaceState(undefined, "", "/faq"); } }); }