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
14 changes: 7 additions & 7 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ 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` — Dynamic pricing cards from `hugo.toml` params
- `layouts/partials/tickets.html` — Tito ticket widget; the `js.tito.io` script is loaded here only, not site-wide
- `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
- `layouts/partials/speaker-card.html` — Reusable speaker card component
Expand All @@ -155,7 +156,7 @@ Commented out (pending content): Keynotes, Sponsors, Tickets, Newsletter CTA
- `[params]` — Conference details (dates, venue, contact, social). Key social params: `twitterHandle`, `mastodonHandle` (`@Python_Ireland`), `mastodonUrl` (`https://mastodon.ie/@Python_Ireland` — instance is mastodon.ie, not mastodon.social), `youtubeUrl`
- `[params.hero]` — Hero section content
- `[params.stats]` — Statistics for counters (attendees, speakers, tracks, days)
- `[[params.tickets]]` — Ticket types with pricing (Student, Early Bird, General, Corporate)
- `ticketsUrl` — Tito event URL (`https://ti.to/<account>/<event>`). Ticket prices are **not** stored in `hugo.toml`: they come from Tito's public checkout endpoint at build time and feed the homepage price range and the Event `offers` JSON-LD
- `[menus.main]` — Navigation menu items (Sponsors menu currently commented out)

**Build configuration:**
Expand Down Expand Up @@ -319,11 +320,10 @@ Commit message style:
<span class="badge">Keynote</span>
{{ end }}

{{ if .Site.Params.tickets }}
{{ range .Site.Params.tickets }}
{{ if .highlight }}
<div class="ticket-highlight">...</div>
{{ end }}
{{ $tito := partialCached "tito-data.html" . }}
{{ if $tito.ok }}
{{ range $tito.releases }}
<p>{{ .name }}: {{ $tito.currencySymbol }}{{ .priceLabel }}</p>
{{ end }}
{{ end }}
```
Expand Down
12 changes: 12 additions & 0 deletions csp-dynamic-loaders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,15 @@
also-loads:
- directive: font-src
domain: fonts.gstatic.com # actual font files served from gstatic

- name: Tito ticket widget
trigger:
directive: script-src
domain: js.tito.io
also-loads:
- directive: style-src
domain: js.tito.io # widget CSS injected by https://js.tito.io/v2
- directive: frame-src
domain: js.tito.io # widget and checkout overlay iframes
- directive: connect-src
domain: checkout.tito.io # event/ticket JSON fetched by the widget
35 changes: 6 additions & 29 deletions hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ enableGitInfo = true
cfpUrl = "https://sessionize.com/pycon-ireland-2026/"
cfpOpens = "2026-05-25"
cfpCloses = "2026-08-30"
ticketsUrl = "https://ti.to/python-ireland/pycon-ireland-2026" # Set to Tito/Eventbrite URL when tickets go on sale
ticketsUrl = "https://ti.to/python-ireland/pycon-ireland-2026" # Tito event URL; ticket names, prices and availability are fetched from Tito at build time
ticketsValidFrom = "2026-10-01" # Date pricing tiers were announced; required by Google's Offer.validFrom check

# Contact & social
Expand Down Expand Up @@ -84,34 +84,6 @@ enableGitInfo = true
tracks = 3
days = 1

[[params.tickets]]
name = "Student"
price = 35
currency = "EUR"
features = ["Full conference access", "Lunch & refreshments", "Community networking"]
highlight = false

# [[params.tickets]]
# name = "Early Bird"
# price = 49
# currency = "EUR"
# features = ["Full conference access", "Lunch & refreshments", "Conference t-shirt", "Workshop access"]
# highlight = true

[[params.tickets]]
name = "General"
price = 59
currency = "EUR"
features = ["Full conference access", "Lunch & refreshments", "Workshop access"]
highlight = false

[[params.tickets]]
name = "Corporate"
price = 159
currency = "EUR"
features = ["Full conference access", "Lunch & refreshments", "Workshop access", "Priority seating", "Networking reception"]
highlight = false

[menus]
[[menus.main]]
name = "Tickets"
Expand Down Expand Up @@ -186,3 +158,8 @@ enableGitInfo = true
name = "Blog"
url = "/blog/"
weight = 70

# Remote resources (Tito ticket data) are cached by Hugo; keep it short so a
# local `hugo server` does not show stale prices forever.
[caches.getresource]
maxAge = "1h"
8 changes: 7 additions & 1 deletion layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,16 @@
<a href="/cfp/" class="text-py-yellow hover:underline">Learn more</a></span>
</span>
{{ end }}
{{- with partialCached "tito-data.html" . }}{{ if .ok }}
<span class="flex items-center gap-2">
<svg class="w-4 h-4 text-py-yellow flex-shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 5v2m0 4v2m0 4v2M5 5a2 2 0 00-2 2v3a2 2 0 110 4v3a2 2 0 002 2h14a2 2 0 002-2v-3a2 2 0 110-4V7a2 2 0 00-2-2H5z"/></svg>
<a href="#tickets">Tickets from <strong class="text-text-primary">€{{ (index .Site.Params.tickets 0).price }}</strong> to <strong class="text-text-primary">€{{ (index .Site.Params.tickets (sub (len .Site.Params.tickets) 1)).price }}</strong></a>
{{- if eq .minPrice .maxPrice }}
<a href="#tickets">Tickets <strong class="text-text-primary">{{ .currencySymbol }}{{ .minPrice }}</strong></a>
{{- else }}
<a href="#tickets">Tickets from <strong class="text-text-primary">{{ .currencySymbol }}{{ .minPrice }}</strong> to <strong class="text-text-primary">{{ .currencySymbol }}{{ .maxPrice }}</strong></a>
{{- end }}
</span>
{{- end }}{{ end }}
</div>
</div>
</section>
Expand Down
9 changes: 7 additions & 2 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,10 @@
{{/* Structured Data / Schema.org */}}
{{ partial "structured-data.html" . }}

{{/* Tito tickets */}}
<script src='https://js.tito.io/v2' async></script>
{{/* Tito tickets: only the homepage renders the widget (partials/tickets.html).
Kept in <head>: loading it next to the widget in <body> left the widget
empty in some Firefox setups. */}}
{{ if .IsHome }}{{ with (partialCached "tito-data.html" .).slug }}
<script src="https://js.tito.io/v2" async></script>
{{ end }}{{ end }}

27 changes: 17 additions & 10 deletions layouts/partials/structured-data.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,24 @@
"organizer": {
"@type": "Organization",
"@id": "{{ .Site.Params.organizerUrl }}#organization"
},
"offers": {
"@type": "AggregateOffer",
"lowPrice": {{ (index .Site.Params.tickets 0).price }},
"highPrice": {{ (index .Site.Params.tickets (sub (len .Site.Params.tickets) 1)).price }},
"offerCount": {{ len .Site.Params.tickets }},
"priceCurrency": "EUR",
"url": "{{ if .Site.Params.ticketsUrl }}{{ .Site.Params.ticketsUrl }}{{ else }}{{ .Site.BaseURL }}{{ end }}",
"availability": "https://schema.org/PreOrder",
"validFrom": "{{ .Site.Params.ticketsValidFrom }}"
}
{{- $tito := partialCached "tito-data.html" . }}
{{- if $tito.ok }}
{{- $offers := slice }}
{{- range $tito.releases }}
{{- $offer := dict
"@type" "Offer"
"name" .name
"price" (printf "%.2f" .price)
"priceCurrency" $tito.currency
"url" site.Params.ticketsUrl
"validFrom" site.Params.ticketsValidFrom
}}
{{- with .availability }}{{ $offer = merge $offer (dict "availability" .) }}{{ end }}
{{- $offers = $offers | append $offer }}
{{- end }},
"offers": {{ $offers | jsonify | safeJS }}
{{- end }}
}
</script>
{{ end }}
Expand Down
8 changes: 6 additions & 2 deletions layouts/partials/tickets.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- $tito := partialCached "tito-data.html" . -}}
<section id="tickets" class="py-24 bg-bg-secondary">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="text-center mb-16">
Expand All @@ -6,11 +7,14 @@ <h2 class="text-3xl sm:text-4xl font-bold text-text-heading mb-4">Tickets</h2>
Secure your spot at {{ .Site.Title }}.
Buy your tickets from
<a href="{{ .Site.Params.ticketsUrl }}" class="text-py-blue-light hover:text-py-yellow font-semibold transition-colors"
target="_blank" rel="me noopener">Tito</a>.
target="_blank" rel="noopener">Tito</a>.
</p>
</div>

<tito-widget event="python-ireland/pycon-ireland-2026"></tito-widget>
{{- with $tito.slug }}
{{- /* The js.tito.io script is loaded from head.html, on the homepage only */}}
<tito-widget event="{{ . }}"></tito-widget>
{{- end }}

</div>
</section>
71 changes: 71 additions & 0 deletions layouts/partials/tito-data.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{{- /*
Ticket data fetched from Tito at build time.

Tito is the single source of truth for ticket names, prices and sale state.
The event slug is derived from site.Params.ticketsUrl
(https://ti.to/<account>/<event>), and the public checkout endpoint used by
the Tito widget itself is queried: https://checkout.tito.io/<slug>.json

Returns a dict:
ok bool false if ticketsUrl is unset or Tito is unreachable
slug string "<account>/<event>" (set whenever ticketsUrl is set)
currency string ISO code, e.g. "EUR"
currencySymbol string e.g. "€"
releases slice dicts: name, price (float), priceLabel, state, availability
minPrice string formatted lowest price (no currency symbol)
maxPrice string formatted highest price

A Tito outage must not break the build: on error a warning is logged and
callers hide price information.

Use with partialCached so Tito is queried once per build.
*/ -}}
{{- $result := dict "ok" false "slug" "" -}}
{{- with site.Params.ticketsUrl -}}
{{- $slug := . | strings.TrimPrefix "https://ti.to/" | strings.TrimSuffix "/" -}}
{{- $result = merge $result (dict "slug" $slug) -}}
{{- $api := printf "https://checkout.tito.io/%s.json" $slug -}}
{{- $remote := try (resources.GetRemote $api) -}}
{{- with $remote.Err -}}
{{- warnf "tito-data: cannot fetch %s: %s" $api . -}}
{{- else with $remote.Value -}}
{{- $event := (. | transform.Unmarshal).event -}}
{{- $availability := dict
"on_sale" "https://schema.org/InStock"
"sold_out" "https://schema.org/SoldOut"
"upcoming" "https://schema.org/PreOrder"
-}}
{{- $releases := slice -}}
{{- $prices := slice -}}
{{- range $event.releases -}}
{{- $price := float .price -}}
{{- $label := cond (eq $price (math.Floor $price)) (printf "%.0f" $price) (printf "%.2f" $price) -}}
{{- $releases = $releases | append (dict
"name" .title
"price" $price
"priceLabel" $label
"state" .state
"availability" (index $availability .state | default "")
) -}}
{{- $prices = $prices | append $price -}}
{{- end -}}
{{- if $releases -}}
{{- $min := math.Min $prices -}}
{{- $max := math.Max $prices -}}
{{- $result = merge $result (dict
"ok" true
"currency" $event.currency
"currencySymbol" $event.currency_symbol
"releases" $releases
"minPrice" (cond (eq $min (math.Floor $min)) (printf "%.0f" $min) (printf "%.2f" $min))
"maxPrice" (cond (eq $max (math.Floor $max)) (printf "%.0f" $max) (printf "%.2f" $max))
) -}}
{{- else -}}
{{- warnf "tito-data: no releases returned by %s" $api -}}
{{- end -}}
{{- else -}}
{{- /* resources.GetRemote returns nil without error on a 404 */ -}}
{{- warnf "tito-data: %s not found (check params.ticketsUrl)" $api -}}
{{- end -}}
{{- end -}}
{{- return $result -}}
Loading