@sarimarcus/content-sites-tourism 0.74.2 → 0.74.3

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,13 @@
2
2
 
3
3
  All packages in the platform release in lockstep; entries are per release version.
4
4
 
5
+ ## 0.74.3 (2026-11-17)
6
+
7
+ Additive. No codemod; only a site rendering `TourismWhatsOnPage` sees a change.
8
+
9
+ - `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.
10
+ - 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.
11
+
5
12
  ## 0.74.2 (2026-11-17)
6
13
 
7
14
  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.3",
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.3",
44
+ "@sarimarcus/content-sites-ui": "0.74.3"
45
45
  }
46
46
  }
@@ -4,7 +4,7 @@
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
 
@@ -61,9 +61,12 @@ const slotAfter = ['after-window-1', 'after-window-2'].map((name) => (Astro.slot
61
61
  {r.blurb && <p class="wo-row__blurb">{r.blurb}</p>}
62
62
  </div>
63
63
  <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>
64
+ <div class="wo-venue">
65
+ {r.venue.image && <span class="wo-venue__img"><ResponsiveImage src={r.venue.image.src} alt={r.venue.image.alt} sizes="56px" loading="lazy" /></span>}
66
+ <p class="wo-row__venue">
67
+ {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>}
68
+ </p>
69
+ </div>
67
70
  <p class="wo-row__price">
68
71
  {r.free && <Badge tone="outline" size="sm" lines={0}>{labels.free}</Badge>}
69
72
  {r.sourceHref && <a href={r.sourceHref} rel="noopener">{labels.source}</a>}
@@ -420,6 +420,9 @@
420
420
  .hp .wo-row__meta { column-gap: 1rem; }
421
421
  .hp .wo-row__venue, .hp .wo-row__price { font-size: 0.9375rem; color: var(--muted-foreground); }
422
422
  .hp .wo-row__price:empty { display: none; }
423
+ .hp .wo-venue { display: flex; align-items: center; gap: 0.625rem; min-width: 0; }
424
+ .hp .wo-venue__img { flex: none; width: 3.5rem; height: 3.5rem; border-radius: calc(var(--radius) * 0.5); overflow: hidden; background: var(--muted); }
425
+ .hp .wo-venue__img img { width: 100%; height: 100%; object-fit: cover; }
423
426
  .hp .wo-row__price { display: flex; flex-wrap: wrap; align-items: center; gap: 0 0.75rem; }
424
427
  .hp .wo-row__main h3 { font-size: 1.0625rem; }
425
428
  .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,7 +13,7 @@ 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;
@@ -28,6 +29,9 @@ 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 }
@@ -78,6 +82,8 @@ export interface WhatsOnBuildOptions {
78
82
  empty: string;
79
83
  regularsIntro: string;
80
84
  locale?: string;
85
+ /** Resolves a venue page (`/monument/<slug>`) to its image, so each row can show a venue card. */
86
+ venueImage?: (venueHref: string) => { src: ImageMetadata; alt: string } | undefined;
81
87
  }
82
88
 
83
89
  /** `2026-11-21` → "21 Nov". */
@@ -93,9 +99,10 @@ const timeOf = (it: AgendaItem) => (it.startDate.length > 10 ? it.startDate.slic
93
99
  const within = (w: DayWindow) => (it: AgendaItem) => startDay(it) >= w.start && startDay(it) <= w.end;
94
100
  const byStart = (a: AgendaItem, b: AgendaItem) => a.startDate.localeCompare(b.startDate) || a.title.localeCompare(b.title);
95
101
 
102
+ /** Only an item's own `/event/` page is internal: a venue link would send the title to the monument. */
96
103
  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 };
104
+ if (it.href?.startsWith('/event/')) return { href: it.href, external: false };
105
+ return it.sourceUrl ? { href: it.sourceUrl, external: true } : { href: it.href ?? it.venue.href ?? '', external: false };
99
106
  }
100
107
 
101
108
  function toRow(it: AgendaItem, o: WhatsOnBuildOptions, locale: string, lead: boolean): WhatsOnRow {
@@ -107,7 +114,7 @@ function toRow(it: AgendaItem, o: WhatsOnBuildOptions, locale: string, lead: boo
107
114
  title: it.title,
108
115
  ...link,
109
116
  time: timeOf(it),
110
- venue: { name: it.venue.name, href: it.venue.href },
117
+ venue: { name: it.venue.name, href: it.venue.href, image: it.venue.href ? o.venueImage?.(it.venue.href) : undefined },
111
118
  free,
112
119
  price: !free && it.priceFrom !== undefined && it.priceFrom > 0 ? o.labels.from.replace('{n}', String(it.priceFrom)) : undefined,
113
120
  ticketsHref: free ? undefined : it.sourceUrl,