@sarimarcus/content-sites-tourism 0.74.2 → 0.74.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  All packages in the platform release in lockstep; entries are per release version.
4
4
 
5
+ ## 0.74.4 (2026-11-17)
6
+
7
+ Additive. No codemod; only a site rendering `TourismWhatsOnPage` sees a change (SLA-4311).
8
+
9
+ - `TourismWhatsOnPage`: "On now" runs render as image cards (venue image, title, span and venue, a two-line blurb) instead of a link list.
10
+ - Every timetable row shows its blurb, not only the lead row and festival teasers.
11
+ - External event links (title, tickets, official listing) open in a new tab (`target="_blank" rel="noopener"`).
12
+ - `WhatsOnRun` gains optional `blurb` and `image`; `buildWhatsOnModel` fills them (the image through `venueImage`).
13
+
14
+ ## 0.74.3 (2026-11-17)
15
+
16
+ Additive. No codemod; only a site rendering `TourismWhatsOnPage` sees a change.
17
+
18
+ - `buildWhatsOnModel`: a row's title links to the item's own `/event/` page, else to its official listing (`external`), never to the venue page; the venue keeps its own link.
19
+ - Venue cards: new optional `venueImage(href) => { src: ImageMetadata; alt }`. A row whose venue page resolves to an image shows a 56px thumbnail (`ResponsiveImage`, `sizes="56px"`) beside the venue name, in a `.wo-venue__img` frame styled like the other `home.css` thumbs.
20
+
5
21
  ## 0.74.2 (2026-11-17)
6
22
 
7
23
  Additive (SLA-4223). No codemod; nothing changes until a site renders the new template or passes the nav entry.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sarimarcus/content-sites-tourism",
3
- "version": "0.74.2",
3
+ "version": "0.74.4",
4
4
  "description": "City-tourism vertical: city-entity components, pages templates and utilities for the tourism sites.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -40,7 +40,7 @@
40
40
  "peerDependencies": {
41
41
  "astro": "^7.0.6",
42
42
  "tailwindcss": "^4.1.18",
43
- "@sarimarcus/content-sites-core": "0.74.2",
44
- "@sarimarcus/content-sites-ui": "0.74.2"
43
+ "@sarimarcus/content-sites-core": "0.74.4",
44
+ "@sarimarcus/content-sites-ui": "0.74.4"
45
45
  }
46
46
  }
@@ -4,14 +4,15 @@
4
4
  * `after-window-1` and `after-window-2` take the affiliate strips between windows. Styles live in home.css.
5
5
  */
6
6
  import { Container } from '@sarimarcus/content-sites-ui/layout';
7
- import { Badge } from '@sarimarcus/content-sites-ui/primitives';
7
+ import { Badge, ResponsiveImage } from '@sarimarcus/content-sites-ui/primitives';
8
8
  import MonthStripNav from './MonthStripNav.astro';
9
9
  import type { WhatsOnModel } from './whatsOnModel.ts';
10
10
 
11
11
  interface Props { model: WhatsOnModel }
12
12
  const { model } = Astro.props;
13
13
  const { head, checked, labels, runs, windows, regulars, months } = model;
14
- const rel = (external: boolean) => (external ? 'noopener' : undefined);
14
+ // An external event page opens in a new tab; a site page keeps the visitor here.
15
+ const out = (external: boolean) => (external ? { target: '_blank', rel: 'noopener' } : {});
15
16
  const slotAfter = ['after-window-1', 'after-window-2'].map((name) => (Astro.slots.has(name) ? name : undefined));
16
17
  ---
17
18
  <main class="hp wo" data-whats-on data-tz={model.timezone}>
@@ -27,11 +28,15 @@ const slotAfter = ['after-window-1', 'after-window-2'].map((name) => (Astro.slot
27
28
  <section class="hp-band hp-band--muted wo-runs" aria-labelledby="wo-runs-h" data-track-zone="runs">
28
29
  <Container>
29
30
  <h2 id="wo-runs-h" class="wo-runs__h">{runs.heading}</h2>
30
- <ul role="list" class="wo-chips">
31
+ <ul role="list" class="wo-cards">
31
32
  {runs.items.map((r) => (
32
- <li data-ends={r.endsOn}>
33
- <a href={r.href} rel={rel(r.external)}>{r.title}</a>
34
- <span class="hp-meta">{r.span} · {r.venue}</span>
33
+ <li class="wo-card" data-ends={r.endsOn}>
34
+ {r.image && <span class="wo-card__img"><ResponsiveImage src={r.image.src} alt={r.image.alt} sizes="(min-width: 52rem) 22rem, 100vw" loading="lazy" /></span>}
35
+ <div class="wo-card__body">
36
+ <h3><a href={r.href} {...out(r.external)}>{r.title}</a></h3>
37
+ <p class="hp-meta">{r.span} · {r.venue}</p>
38
+ {r.blurb && <p class="wo-card__blurb">{r.blurb}</p>}
39
+ </div>
35
40
  </li>
36
41
  ))}
37
42
  </ul>
@@ -55,19 +60,22 @@ const slotAfter = ['after-window-1', 'after-window-2'].map((name) => (Astro.slot
55
60
  <li class:list={['wo-row', { 'is-lead': r.lead }]} data-ends={r.endsOn} data-key={r.id}>
56
61
  <span class="wo-row__time">{r.time ?? ''}</span>
57
62
  <div class="wo-row__main">
58
- <h3><a href={r.href} rel={rel(r.external)}>{r.title}</a></h3>
63
+ <h3><a href={r.href} {...out(r.external)}>{r.title}</a></h3>
59
64
  {r.lead && <span class="wo-pick">{labels.pick}</span>}
60
65
  {r.until && <span class="hp-meta wo-until">{r.until}</span>}
61
66
  {r.blurb && <p class="wo-row__blurb">{r.blurb}</p>}
62
67
  </div>
63
68
  <div class="wo-row__meta">
64
- <p class="wo-row__venue">
65
- {r.venue.href ? <a class="hp-quiet" href={r.venue.href}><span class="sr-only">{labels.venue}: </span>{r.venue.name}</a> : <span>{r.venue.name}</span>}
66
- </p>
69
+ <div class="wo-venue">
70
+ {r.venue.image && <span class="wo-venue__img"><ResponsiveImage src={r.venue.image.src} alt={r.venue.image.alt} sizes="56px" loading="lazy" /></span>}
71
+ <p class="wo-row__venue">
72
+ {r.venue.href ? <a class="hp-quiet" href={r.venue.href}><span class="sr-only">{labels.venue}: </span>{r.venue.name}</a> : <span>{r.venue.name}</span>}
73
+ </p>
74
+ </div>
67
75
  <p class="wo-row__price">
68
76
  {r.free && <Badge tone="outline" size="sm" lines={0}>{labels.free}</Badge>}
69
- {r.sourceHref && <a href={r.sourceHref} rel="noopener">{labels.source}</a>}
70
- {r.ticketsHref && <a href={r.ticketsHref} rel="noopener">{labels.tickets}{r.price ? ` · ${r.price}` : ''}</a>}
77
+ {r.sourceHref && <a href={r.sourceHref} {...out(true)}>{labels.source}</a>}
78
+ {r.ticketsHref && <a href={r.ticketsHref} {...out(true)}>{labels.tickets}{r.price ? ` · ${r.price}` : ''}</a>}
71
79
  </p>
72
80
  </div>
73
81
  </li>
@@ -93,7 +101,7 @@ const slotAfter = ['after-window-1', 'after-window-2'].map((name) => (Astro.slot
93
101
  <ul role="list" class="wo-reg">
94
102
  {regulars.items.map((r) => (
95
103
  <li data-ends={r.endsOn}>
96
- <h3><a href={r.href} rel={rel(r.external)}>{r.title}</a></h3>
104
+ <h3><a href={r.href} {...out(r.external)}>{r.title}</a></h3>
97
105
  <p class="hp-meta">{r.recurrence ? `${r.recurrence} · ` : ''}{r.venue}</p>
98
106
  </li>
99
107
  ))}
@@ -399,14 +399,18 @@
399
399
 
400
400
  /* What's on: day-by-day timetable (SLA-4223) */
401
401
  .hp.wo [hidden] { display: none !important; }
402
- .hp :is(.wo-row__main h3, .wo-reg h3) a, .hp :is(.wo-row__venue, .wo-row__price, .wo-chips) a { display: inline-flex; align-items: center; min-width: 2.75rem; min-height: 2.75rem; }
402
+ .hp :is(.wo-row__main h3, .wo-reg h3) a, .hp :is(.wo-row__venue, .wo-row__price, .wo-card h3) a { display: inline-flex; align-items: center; min-width: 2.75rem; min-height: 2.75rem; }
403
403
  .hp .wo-lead { padding-bottom: 1.5rem; }
404
404
  .hp .wo-checked { margin-top: 0.75rem; }
405
405
  .hp .wo-band { position: sticky; top: var(--wo-sticky, var(--site-header-offset, 4rem)); z-index: 2; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.75rem; margin: 0 0 1rem; padding-block: 0.625rem; background: var(--background); border-bottom: var(--hp-rule); font-size: 1.25rem; }
406
406
  .hp .wo-window { padding-block: clamp(1.5rem, 3vw, 2.5rem); }
407
407
  .hp .wo-empty { color: var(--muted-foreground); }
408
- .hp .wo-chips { display: grid; gap: 0.5rem 1.5rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
409
- .hp .wo-chips li { display: grid; gap: 0.125rem; padding-block: 0.5rem; border-top: var(--hp-rule); }
408
+ .hp .wo-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
409
+ .hp .wo-card { display: grid; grid-template-rows: auto 1fr; overflow: hidden; border: var(--hp-rule); border-radius: var(--radius); background: var(--background); }
410
+ .hp .wo-card__img { display: block; aspect-ratio: 16 / 9; background: var(--muted); }
411
+ .hp .wo-card__body { display: grid; align-content: start; gap: 0.25rem; padding: 0.875rem 1rem 1rem; }
412
+ .hp .wo-card h3 { font-size: 1.0625rem; }
413
+ .hp .wo-card__blurb { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; margin-top: 0.25rem; font-size: 0.9375rem; }
410
414
  .hp .wo-runs__h { font-size: 1rem; margin-bottom: 0.75rem; }
411
415
  .hp .wo-days { display: grid; gap: 0; }
412
416
  .hp .wo-day { display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: 0 1rem; padding-block: 1rem; border-bottom: var(--hp-rule); }
@@ -420,6 +424,9 @@
420
424
  .hp .wo-row__meta { column-gap: 1rem; }
421
425
  .hp .wo-row__venue, .hp .wo-row__price { font-size: 0.9375rem; color: var(--muted-foreground); }
422
426
  .hp .wo-row__price:empty { display: none; }
427
+ .hp .wo-venue { display: flex; align-items: center; gap: 0.625rem; min-width: 0; }
428
+ .hp .wo-venue__img { flex: none; width: 3.5rem; height: 3.5rem; border-radius: calc(var(--radius) * 0.5); overflow: hidden; background: var(--muted); }
429
+ .hp .wo-venue__img img { width: 100%; height: 100%; object-fit: cover; }
423
430
  .hp .wo-row__price { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.75rem; }
424
431
  .hp .wo-row__main h3 { font-size: 1.0625rem; }
425
432
  .hp .wo-row__blurb { flex-basis: 100%; max-width: 40rem; margin-bottom: 0.25rem; color: var(--foreground); font-size: 0.9375rem; }
@@ -1,3 +1,4 @@
1
+ import type { ImageMetadata } from 'astro';
1
2
  import type { AgendaItem } from '@sarimarcus/content-sites-core/schema';
2
3
  import { agendaDay, addDays, formatUtcDate, isExpired, overlapsWindow } from '@sarimarcus/content-sites-core/dates';
3
4
  import type { AgendaWindows, DayWindow } from '@sarimarcus/content-sites-core/dates';
@@ -12,14 +13,14 @@ export interface WhatsOnRow {
12
13
  external: boolean;
13
14
  /** "20:00", only when the source gives a time. */
14
15
  time?: string;
15
- venue: { name: string; href?: string };
16
+ venue: WhatsOnVenue;
16
17
  free: boolean;
17
18
  /** "from €12". */
18
19
  price?: string;
19
20
  ticketsHref?: string;
20
21
  /** The official listing of a free item whose title links to a site page. */
21
22
  sourceHref?: string;
22
- /** The lead row's blurb, or the teaser of an item whose `/event/` page owns the detail. */
23
+ /** What the event is: every row carries its blurb (a teaser when an `/event/` page owns the detail). */
23
24
  blurb?: string;
24
25
  lead: boolean;
25
26
  /** Last day, ISO: the inline script hides the row once it is past. */
@@ -28,12 +29,20 @@ export interface WhatsOnRow {
28
29
  until?: string;
29
30
  }
30
31
 
32
+ /** The venue card: its name, its page when it has one, and the image the site resolved for that page. */
33
+ export interface WhatsOnVenue { name: string; href?: string; image?: { src: ImageMetadata; alt: string } }
34
+
31
35
  export interface WhatsOnDay { day: string; weekday: string; numeral: string; month: string; rows: WhatsOnRow[] }
32
36
 
33
37
  export interface WhatsOnWindow { id: string; heading: string; range: string; days: WhatsOnDay[]; empty: string }
34
38
 
35
- /** A multi-day item already under way, shown once with its span. */
36
- export interface WhatsOnRun { id: string; title: string; href: string; external: boolean; span: string; venue: string; endsOn: string }
39
+ /** A multi-day item already under way, shown once as a card with its span. */
40
+ export interface WhatsOnRun {
41
+ id: string; title: string; href: string; external: boolean; span: string; venue: string; endsOn: string;
42
+ blurb?: string;
43
+ /** The venue page's image, when the site resolves one. */
44
+ image?: { src: ImageMetadata; alt: string };
45
+ }
37
46
 
38
47
  /** A recurring item of the thin-week fallback. */
39
48
  export interface WhatsOnRegular { id: string; title: string; href: string; external: boolean; recurrence: string; venue: string; endsOn?: string }
@@ -78,6 +87,8 @@ export interface WhatsOnBuildOptions {
78
87
  empty: string;
79
88
  regularsIntro: string;
80
89
  locale?: string;
90
+ /** Resolves a venue page (`/monument/<slug>`) to its image, so each row can show a venue card. */
91
+ venueImage?: (venueHref: string) => { src: ImageMetadata; alt: string } | undefined;
81
92
  }
82
93
 
83
94
  /** `2026-11-21` → "21 Nov". */
@@ -93,9 +104,10 @@ const timeOf = (it: AgendaItem) => (it.startDate.length > 10 ? it.startDate.slic
93
104
  const within = (w: DayWindow) => (it: AgendaItem) => startDay(it) >= w.start && startDay(it) <= w.end;
94
105
  const byStart = (a: AgendaItem, b: AgendaItem) => a.startDate.localeCompare(b.startDate) || a.title.localeCompare(b.title);
95
106
 
107
+ /** Only an item's own `/event/` page is internal: a venue link would send the title to the monument. */
96
108
  function target(it: AgendaItem): { href: string; external: boolean } {
97
- const href = it.href ?? it.venue.href;
98
- return href ? { href, external: false } : { href: it.sourceUrl, external: true };
109
+ if (it.href?.startsWith('/event/')) return { href: it.href, external: false };
110
+ return it.sourceUrl ? { href: it.sourceUrl, external: true } : { href: it.href ?? it.venue.href ?? '', external: false };
99
111
  }
100
112
 
101
113
  function toRow(it: AgendaItem, o: WhatsOnBuildOptions, locale: string, lead: boolean): WhatsOnRow {
@@ -107,12 +119,12 @@ function toRow(it: AgendaItem, o: WhatsOnBuildOptions, locale: string, lead: boo
107
119
  title: it.title,
108
120
  ...link,
109
121
  time: timeOf(it),
110
- venue: { name: it.venue.name, href: it.venue.href },
122
+ venue: { name: it.venue.name, href: it.venue.href, image: it.venue.href ? o.venueImage?.(it.venue.href) : undefined },
111
123
  free,
112
124
  price: !free && it.priceFrom !== undefined && it.priceFrom > 0 ? o.labels.from.replace('{n}', String(it.priceFrom)) : undefined,
113
125
  ticketsHref: free ? undefined : it.sourceUrl,
114
126
  sourceHref: free && !link.external ? it.sourceUrl : undefined,
115
- blurb: lead || it.href?.startsWith('/event/') ? it.blurb : undefined,
127
+ blurb: it.blurb,
116
128
  lead,
117
129
  endsOn: last,
118
130
  until: last > startDay(it) ? o.labels.until.replace('{day}', shortDay(last, locale)) : undefined,
@@ -169,7 +181,10 @@ export function buildWhatsOnModel(o: WhatsOnBuildOptions): Pick<WhatsOnModel, 'r
169
181
  const regulars = thin ? o.items.filter((i) => i.kind === 'recurring' && !isExpired(i, today) && startDay(i) <= horizon.end) : [];
170
182
  return {
171
183
  runs: runs.length
172
- ? { heading: h.runs, items: runs.map((i) => ({ id: i.id, title: i.title, ...target(i), span: rangeLabel({ start: startDay(i), end: lastDay(i) }, locale), venue: i.venue.name, endsOn: lastDay(i) })) }
184
+ ? { heading: h.runs, items: runs.map((i) => ({
185
+ id: i.id, title: i.title, ...target(i), span: rangeLabel({ start: startDay(i), end: lastDay(i) }, locale), venue: i.venue.name, endsOn: lastDay(i),
186
+ blurb: i.blurb, image: i.venue.href ? o.venueImage?.(i.venue.href) : undefined,
187
+ })) }
173
188
  : undefined,
174
189
  windows,
175
190
  regulars: regulars.length