Skip to content

Commit d0d3952

Browse files
Mazizovaclaude
andauthored
Pop-up: drive it from data/popups.yaml and announce the FOSDEM 2027 booth call (#250)
The first entry that has not ended is shown, never on the page it links to. The DuckDB × MySQL Day entry keeps its copy and ends after the event; the new entry links to the booth call-for-projects post and ends after November 30. Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent 093d94a commit d0d3952

2 files changed

Lines changed: 48 additions & 15 deletions

File tree

‎data/popups.yaml‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Announcement pop-ups (bottom left, after 10 seconds; see
2+
# layouts/partials/event-popup.html). Only the FIRST entry that is still
3+
# running is shown, so list them in priority order.
4+
#
5+
# id stable key; closing a pop-up is remembered per id for that visit
6+
# page content page it links to; its cover.jpg is the picture
7+
# end first day it is NOT shown (so the last day it shows is the day before)
8+
# kicker, title, text, cta the copy
9+
- id: duckdb-mysql-day
10+
page: /events/duckdb-mysql-day
11+
end: "2026-11-18"
12+
kicker: "November 17 · Online · Free"
13+
title: "DuckDB × MySQL Day"
14+
text: "A one-day online conference on fast analytics for MySQL."
15+
cta: "See the speakers & register →"
16+
17+
- id: fosdem-2027-booth
18+
page: /blog/fosdem-2027-booth-call-for-projects
19+
end: "2026-12-01"
20+
kicker: "FOSDEM 2027 · Apply by November 30"
21+
title: "Share our booth at FOSDEM 2027"
22+
text: "We are inviting five open source MySQL-compatible projects, with up to $1,000 of support each."
23+
cta: "Read more & apply →"

‎layouts/partials/event-popup.html‎

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,31 @@
1-
{{/* Announcement pop-up for the featured event (DuckDB × MySQL Day). Slides in at
2-
the bottom left of any page after 10 seconds and links to the event page.
3-
Closing it (or clicking through) hides it for the rest of that visit only
4-
(sessionStorage), so it shows again on the next visit. Not rendered on the event
5-
page itself or once the event date has passed. Text comes from the event
6-
page's front matter; timing and dismissal live in the inline script. */}}
7-
{{ $ev := site.GetPage "/events/duckdb-mysql-day" }}
8-
{{ if and $ev (now.Before ($ev.Date.AddDate 0 0 1)) (ne $.RelPermalink $ev.RelPermalink) }}
9-
{{ $cover := $ev.Resources.GetMatch "cover.jpg" }}
10-
<aside class="ev-popup" id="event-popup" hidden aria-label="Event announcement" data-id="duckdb-mysql-day" data-end="{{ $ev.Date.AddDate 0 0 1 | time.Format "2006-01-02T00:00:00Z" }}">
1+
{{/* Announcement pop-up. Slides in at the bottom left of any page after 10
2+
seconds and links to the announced page. Closing it (or clicking through)
3+
hides it for the rest of that visit only (sessionStorage), so it shows
4+
again on the next visit. What it announces comes from data/popups.yaml:
5+
the first entry that has not ended yet is shown, and never on the page it
6+
links to. Timing and dismissal live in the inline script. */}}
7+
{{ $popup := dict }}
8+
{{ range site.Data.popups }}
9+
{{ if not $popup }}
10+
{{ $p := site.GetPage .page }}
11+
{{ $end := time.AsTime .end }}
12+
{{ if and $p (now.Before $end) (ne $.RelPermalink $p.RelPermalink) }}
13+
{{ $popup = merge . (dict "pg" $p "endT" $end) }}
14+
{{ end }}
15+
{{ end }}
16+
{{ end }}
17+
{{ with $popup }}
18+
{{ $pg := .pg }}
19+
{{ $cover := $pg.Resources.GetMatch "cover.jpg" }}
20+
<aside class="ev-popup" id="event-popup" hidden aria-label="Announcement" data-id="{{ .id }}" data-end="{{ .endT | time.Format "2006-01-02T00:00:00Z" }}">
1121
<button type="button" class="ev-popup-close" aria-label="Close announcement">&times;</button>
12-
<a href="{{ $ev.RelPermalink }}" class="ev-popup-link">
22+
<a href="{{ $pg.RelPermalink }}" class="ev-popup-link">
1323
{{ with $cover }}{{ $img := .Resize "640x q80" }}<img src="{{ $img.RelPermalink }}" width="{{ $img.Width }}" height="{{ $img.Height }}" alt="" class="ev-popup-img" loading="lazy">{{ end }}
1424
<span class="ev-popup-body">
15-
<span class="ev-popup-kicker">{{ $ev.Date.Format "January 2" }} · {{ with $ev.Params.home_meta }}{{ . }}{{ else }}Online{{ end }}</span>
16-
<span class="ev-popup-title">{{ $ev.Title }}</span>
17-
<span class="ev-popup-text">A one-day online conference on fast analytics for MySQL.</span>
18-
<span class="ev-popup-cta">See the speakers &amp; register →</span>
25+
<span class="ev-popup-kicker">{{ .kicker }}</span>
26+
<span class="ev-popup-title">{{ .title }}</span>
27+
<span class="ev-popup-text">{{ .text }}</span>
28+
<span class="ev-popup-cta">{{ .cta }}</span>
1929
</span>
2030
</a>
2131
</aside>

0 commit comments

Comments
 (0)