Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ The site implements **comprehensive JSON-LD schemas** across three layers:
- `layouts/partials/about.html` — About section with feature cards from `site.yml`
- `layouts/partials/sponsors-home.html` — Homepage sponsor logos by tier
- `layouts/partials/venue-home.html` — Venue showcase
- `layouts/partials/tickets.html` — Tito ticket widget; the `js.tito.io` script is loaded here only, not site-wide
- `layouts/partials/tickets.html` — Tito ticket widget. The `js.tito.io` script is loaded from `head.html` on the homepage only (not site-wide). Tito's script resets the scroll position on `popstate`, so same-page anchor links are handled in `nav.html` with `pushState`
- `layouts/partials/tito-data.html` — Fetches ticket names, prices and sale state from Tito at build time (use with `partialCached`)
- `layouts/partials/stats.html` — Animated statistics counters
- `layouts/partials/keynotes.html` — Featured keynote speakers
Expand Down
24 changes: 24 additions & 0 deletions layouts/partials/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,28 @@
document.addEventListener('touchstart', function(e) {
if (!e.target.closest('[data-dropdown]')) closeAllDropdowns();
});

// Same-page anchor links (e.g. "/#tickets" clicked on the homepage).
// The Tito widget script runs vue-router in this page: it listens to
// "popstate", which a native fragment navigation fires, and then calls
// window.scrollTo(0, 0), sending the visitor back to the top (Firefox).
// Scroll ourselves and update the URL with pushState, which does not fire
// popstate.
document.addEventListener('click', function(e) {
if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;
const link = e.target.closest('a[href*="#"]');
if (!link || link.target || link.origin !== location.origin || link.pathname !== location.pathname || !link.hash) return;
const target = document.getElementById(decodeURIComponent(link.hash.slice(1)));
if (!target) return;
e.preventDefault();

// Close the mobile menu if the link was inside it
const mobileMenu = document.getElementById('mobile-menu');
if (mobileMenu && mobileMenu.contains(link) && !mobileMenu.classList.contains('hidden')) {
document.getElementById('menu-toggle').click();
}

target.scrollIntoView({ behavior: 'smooth' });
if (location.hash !== link.hash) history.pushState(null, '', link.hash);
});
</script>
Loading