Repository navigation
Load Tito widget on homepage only and source ticket prices from Tito - #164
Merged
Merged
Conversation
- Move the js.tito.io script from head.html (every page) into partials/tickets.html, next to the widget, so other pages no longer download ~10 Tito JS/CSS files - Add partials/tito-data.html: fetch ticket names, prices and sale state from Tito's public checkout endpoint at build time; a Tito outage or bad slug logs a warning and hides prices instead of failing the build - Derive the widget event slug from params.ticketsUrl instead of hardcoding it - Homepage price range now comes from Tito - Event JSON-LD: one Offer per Tito release with real availability (InStock/SoldOut/PreOrder) instead of an AggregateOffer hardcoded to PreOrder - Remove [[params.tickets]] from hugo.toml (stale prices and features not offered on Tito); cap the getresource cache at 1h - Drop rel="me" from the Tito link (identity-verification attribute) - Declare Tito in csp-dynamic-loaders.yml (style-src, frame-src, connect-src) so the CSP checker guards the widget - Update CLAUDE.md accordingly
✅ Deploy Preview for pycon-ireland-2026 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Loading js.tito.io next to the widget in <body> left the widget empty in some Firefox setups (reproduced on the deploy preview, while the same browser renders it fine when the script is in <head>). Keep the script in <head>, but only on the homepage, which is the only page rendering the widget.
matrixise
added a commit
that referenced
this pull request
Nov 18, 2026
The Tito widget script runs vue-router in the host page. It listens to popstate, which a native fragment navigation fires, and then calls window.scrollTo(0, 0). On the homepage, clicking "Tickets" in the menu (/#tickets) or the hero price link (#tickets) left Firefox at the top of the page. - nav.html: intercept left-clicks on same-page anchor links, scroll to the target with scrollIntoView and update the URL with pushState, which does not fire popstate - Close the mobile menu when such a link is clicked inside it - CLAUDE.md: tickets.html no longer loads the Tito script (it is in head.html on the homepage only since #164); document the workaround
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
https://js.tito.io/v2was loaded fromhead.htmlon every page (~10 JS/CSS requests on/schedule/,/speakers/, blog posts…). It is now emitted in<head>only when.IsHome(the only page rendering the widget). An earlier revision placed it in<body>next to the widget, but that left the widget empty in some Firefox setups, so it stays in<head>.partials/tito-data.htmlfetcheshttps://checkout.tito.io/<account>/<event>.json(the same public endpoint the widget uses) at build time viaresources.GetRemote. It feeds:offers: oneOfferper Tito release with realavailability(on_sale→InStock,sold_out→SoldOut,upcoming→PreOrder). Previously this was anAggregateOfferhardcoded toPreOrderwhile tickets were on sale.<tito-widget event="…">value is derived fromparams.ticketsUrl.[[params.tickets]]fromhugo.toml: duplicated prices plusfeatureslists that were no longer displayed and advertised perks not offered on Tito.rel="me"removed from the Tito link (it is an identity-verification attribute).csp-dynamic-loaders.yml(style-src,frame-srcjs.tito.io;connect-srccheckout.tito.io). No CSP change needed.[caches.getresource] maxAge = "1h"sohugo serverdoes not keep stale prices forever (Hugo's default is to cache remote resources indefinitely).Failure mode
If Tito is unreachable or the slug is wrong, the build does not fail: a
WARN tito-data: …is logged, the price line and theoffersblock are omitted, and the widget still renders.Verification
hugo --minifybuilds; homepage showsTickets from €35 to €159; JSON-LD contains 3Offers (Corporate 159, General 59, Student 35), allInStock.HUGO_PARAMS_TICKETSURL=https://ti.to/python-ireland/does-not-exist: warning logged, no price line, nooffers, build succeeds./schedule/and/blog/; widget loads on/.scripts/check-csp.py --verbose(with pyyaml): passes, including the 3 new Tito dynamic-loader pairs.Note: the checkout overlay only opens on origins allowed in the Tito dashboard (
2026.pycon.ie). Onlocalhostand likely on the deploy preview, the widget renders but "Continue" does nothing. This is expected and unrelated to this change. Please check checkout on production after merge.🤖 Generated with Claude Code