fix(scroll): clear URL hash when back-to-top is clicked

Uses history.pushState to strip the stale #entry-slug without
triggering a page jump, then smooth-scrolls to the top.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vgmzx8VTTTmCskSpQtsLTr
This commit is contained in:
2026-06-21 20:41:41 +02:00
parent 7c9a55224a
commit bc77baca2e
@@ -567,6 +567,7 @@ document.addEventListener('DOMContentLoaded', function () {
var threshold = window.innerHeight * 0.8; var threshold = window.innerHeight * 0.8;
var shown = false; var shown = false;
btn.addEventListener('click', function () { btn.addEventListener('click', function () {
history.pushState(null, '', window.location.pathname + window.location.search);
window.scrollTo({ top: 0, behavior: 'smooth' }); window.scrollTo({ top: 0, behavior: 'smooth' });
}); });
window.addEventListener('scroll', function () { window.addEventListener('scroll', function () {