/** * blame.ts — interactivity for the code blame page. * * Registered as: window.MusePages['blame'] */ export function initBlame(_data: Record): void { // Line hash navigation: highlight target line on load and hash change function highlightTargetLine(): void { document.querySelectorAll('.blm-code-row--targeted').forEach((el) => { el.classList.remove('blm-code-row--targeted'); }); const hash = window.location.hash; if (!hash) return; const target = document.querySelector(hash); if (target && target.classList.contains('blm-code-row')) { target.classList.add('blm-code-row--targeted'); target.scrollIntoView({ behavior: 'smooth', block: 'center' }); } } highlightTargetLine(); window.addEventListener('hashchange', highlightTargetLine); }