@sarimarcus/content-sites-tourism 0.66.0 → 0.68.0

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,30 @@
2
2
 
3
3
  All packages in the platform release in lockstep; entries are per release version.
4
4
 
5
+ ## 0.68.0 (2026-11-13)
6
+
7
+ Additive (SLA-4105).
8
+
9
+ - New `TourismItinerariesHub` template (with `TourismItinerariesModel`, `HubItinerary` types) on its own subpath, `@sarimarcus/content-sites-tourism/templates/itineraries`, so its scoped styles load only on the page that renders it, never through the `templates` barrel. It renders the itineraries hub that Córdoba shipped in SLA-4104, with one named slot per tour block.
10
+ - Codemod `scripts/platform/migrations/tourism-itineraries-hub.mjs` moves a site's `src/pages/itineraries.astro` onto the template (Córdoba).
11
+
12
+ ### Breaking
13
+
14
+ - Córdoba's `src/pages/itineraries.astro` moves onto `TourismItinerariesHub`: after `pin-bump.mjs` and `rewrite-imports.mjs --delete-local`, run `scripts/platform/migrations/tourism-itineraries-hub.mjs --site-root=<site>` (a no-op on sites without that page) (SLA-4105).
15
+
16
+ ### Intended output changes
17
+
18
+ - `turism-cordoba-en=html:itineraries.html` — the page renders from the package template; markup reorganised, content preserved (codemod assertions plus browser checks at 375/768/1440px).
19
+
20
+ ## 0.67.0 (2026-11-12)
21
+
22
+ Additive (SLA-4074).
23
+
24
+ - `MonumentHero`: the hours and fees chips no longer cut the value at its first comma. New optional `hoursSummary` and `feesSummary` props (at most 40 characters) are shown when set; otherwise the full value shows only when it is at most 40 characters and not hedged ("check", "varies", "not stated"…), and the chip is left out. The rule is exported as `heroChip` with `HERO_CHIP_MAX`.
25
+ - New `LocationMap` (sections): a single-pin map of one entity next to its address, link-free, rendering nothing without coordinates. The map engine is the site's, passed as `map` from a site adapter.
26
+ - New `CountryLocator` with `countryLocatorLayout` and `countryAt` (sections): a static SVG inset of country outlines with a pin and a place label (linked when `href` is set, outside the SVG). The view widens to hold a pin outside the home country; a disputed area is drawn dashed. Outlines come from `scripts/locator/build-outlines.mjs` (Natural Earth).
27
+ - `MonumentBody`: new optional `inset` slot rendered between two body articles after slot `insetAfter` (default 1, after the first section). Without it the output is unchanged.
28
+
5
29
  ## 0.66.0 (2026-11-12)
6
30
 
7
31
  Additive.
package/README.md CHANGED
@@ -15,5 +15,13 @@ strip, Itineraries, Events and the mobile accordion) on the ui navigation shells
15
15
  passes every link, label and count as props (`TourismNavigationProps`) and its logo through the `logo` slot, so the
16
16
  hrefs stay in the site where the link gate reads them.
17
17
 
18
+ `TourismItinerariesHub` (`templates/itineraries`) renders the itinerary hub from a resolved
19
+ `TourismItinerariesModel`: hero and byline, stays, arrival fare table, day trips, regional routes,
20
+ month planning and FAQ. The route imports `home.css`, keeps Layout, schema and breadcrumbs,
21
+ and resolves every label, href, date and image from its itinerary registry. The `map` slot
22
+ holds the site map; `tour-disclosure` and each `plan.tours.items[].slot` hold the site's
23
+ affiliate adapters. Tour links use an always-static `CardCarousel`. Regional route lead and
24
+ tours are optional. The template owns the `.itn-*` styles.
25
+
18
26
  Depends on `@sarimarcus/content-sites-core` and `@sarimarcus/content-sites-ui` (exact lockstep peers).
19
27
  Nothing may depend on it. Sites import `@sarimarcus/content-sites-tourism/tailwind.css` the same way as ui's.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sarimarcus/content-sites-tourism",
3
- "version": "0.66.0",
3
+ "version": "0.68.0",
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",
@@ -29,6 +29,7 @@
29
29
  "./cards": "./src/cards/index.ts",
30
30
  "./sections": "./src/sections/index.ts",
31
31
  "./templates": "./src/templates/index.ts",
32
+ "./templates/itineraries": "./src/templates/itineraries.ts",
32
33
  "./schema": "./src/schema/index.ts",
33
34
  "./neighborhoods": "./src/templates/neighborhoods.ts",
34
35
  "./llms": "./src/llms/index.ts",
@@ -38,7 +39,7 @@
38
39
  "peerDependencies": {
39
40
  "astro": "^7.0.6",
40
41
  "tailwindcss": "^4.1.18",
41
- "@sarimarcus/content-sites-core": "0.66.0",
42
- "@sarimarcus/content-sites-ui": "0.66.0"
42
+ "@sarimarcus/content-sites-core": "0.68.0",
43
+ "@sarimarcus/content-sites-ui": "0.68.0"
43
44
  }
44
45
  }
@@ -0,0 +1,35 @@
1
+ ---
2
+ /**
3
+ * CountryLocator — a small static locator: country outlines, one pin and a place label, so a reader sees where an
4
+ * entity sits in the country. No tiles, no script; fixed aspect ratio from the layout (no layout shift). The label
5
+ * links (`href`) outside the SVG, so a map placed next to it stays link-free.
6
+ */
7
+ import type { CountryLocatorLayout } from './countryLocator.ts';
8
+
9
+ interface Props {
10
+ layout: CountryLocatorLayout;
11
+ label: string;
12
+ href?: string;
13
+ ariaLabel: string;
14
+ class?: string;
15
+ }
16
+
17
+ const { layout, label, href, ariaLabel, class: className = '' } = Astro.props;
18
+ const { width, height, shapes, pin } = layout;
19
+ const fill = { home: 'fill-primary/15 stroke-foreground/60', disputed: 'fill-primary/15 stroke-foreground/60', neighbour: 'fill-card stroke-border' };
20
+ ---
21
+
22
+ <figure class:list={['m-0', className]} data-country-locator data-pagefind-ignore>
23
+ <svg viewBox={`0 0 ${width} ${height}`} width={width} height={height} role="img" aria-label={ariaLabel} class="block w-full h-auto rounded-lg border border-border bg-muted">
24
+ {shapes.map((s) => (
25
+ <path d={s.d} class={fill[s.role]} stroke-width="1" stroke-linejoin="round" stroke-dasharray={s.role === 'disputed' ? '3 2' : undefined} vector-effect="non-scaling-stroke">
26
+ <title>{s.name}</title>
27
+ </path>
28
+ ))}
29
+ <circle cx={pin.x} cy={pin.y} r="9" class="fill-primary/20" />
30
+ <circle cx={pin.x} cy={pin.y} r="4.5" class="fill-primary stroke-card" stroke-width="1.5" />
31
+ </svg>
32
+ <figcaption class="mt-2 text-sm text-muted-foreground">
33
+ {href ? <a href={href} class="underline underline-offset-2 hover:text-primary">{label}</a> : label}
34
+ </figcaption>
35
+ </figure>
@@ -0,0 +1,47 @@
1
+ ---
2
+ /**
3
+ * LocationMap — a single-pin map of ONE entity's own location, placed headingless next to its address (QuickFacts'
4
+ * `after` slot or the end of a "Practical information" box), or under a heading when standalone.
5
+ *
6
+ * The map engine is the site's (`map`: a component taking `stops`, `showPolyline` and `height`, which reserves its
7
+ * height and initialises lazily); each site binds it once in its LocationMap adapter.
8
+ *
9
+ * MUST stay link-free: audit-related-zone.mjs treats a link-bearing section after the FAQ as a related-content tail
10
+ * block. Renders nothing without coordinates: an empty map container reads as a broken page.
11
+ */
12
+ export interface LocationMapEngineProps {
13
+ stops: { order: number; name: string; coordinates: { lat: number; lng: number } }[];
14
+ showPolyline: boolean;
15
+ height: string;
16
+ }
17
+
18
+ interface Props {
19
+ /** The site's map engine component. */
20
+ map: (props: LocationMapEngineProps) => unknown;
21
+ /** The entity's display name; labels the pin. */
22
+ name: string;
23
+ coordinates?: { lat: number; lng: number } | null;
24
+ /** Omit inside a facts block (the address above it is the label). */
25
+ heading?: string;
26
+ headingLevel?: 2 | 3;
27
+ height?: string;
28
+ class?: string;
29
+ }
30
+
31
+ const {
32
+ map: Map, name, coordinates, heading, headingLevel = 2,
33
+ height = '300px', class: className,
34
+ } = Astro.props;
35
+
36
+ const Heading = `h${headingLevel}` as 'h2' | 'h3';
37
+ const stops = coordinates ? [{ order: 1, name, coordinates }] : [];
38
+ ---
39
+
40
+ {coordinates && (
41
+ <div class:list={[className]} data-pagefind-ignore>
42
+ {heading && (
43
+ <Heading class="text-2xl font-semibold mb-4 font-display">{heading}</Heading>
44
+ )}
45
+ <Map stops={stops} showPolyline={false} height={height} />
46
+ </div>
47
+ )}
@@ -11,6 +11,8 @@
11
11
  * - authored `interludes[]` at their `afterSection`
12
12
  * - the band after slot `pickBandSlot()` (core interludes), which avoids
13
13
  * slots holding an authored interlude whenever a free one exists
14
+ * - the optional `inset` slot (e.g. the practical block) after slot `insetAfter`, between two articles like the
15
+ * band, after the band when both share a slot; the caller wraps it in its own Container
14
16
  *
15
17
  * Markdown stays the site's: `renderMarkdown` renders the tip body, `renderInline` the interlude strings (wrapped in
16
18
  * trustedHtml here), and `tagLinks` rewrites the section HTML (the site's affiliate tagging; identity by default).
@@ -28,6 +30,8 @@ interface Props {
28
30
  bandAfter?: number;
29
31
  /** Whether the band renders. `Astro.slots.has` only says the slot was passed, not that it has content. */
30
32
  hasBand?: boolean;
33
+ /** Slot index the `inset` slot follows (1 = after the first section). */
34
+ insetAfter?: number;
31
35
  proseClass?: string;
32
36
  renderMarkdown: (markdown: string) => string;
33
37
  renderInline: (markdown: string) => string;
@@ -42,6 +46,7 @@ const {
42
46
  leadTip,
43
47
  bandAfter = 2,
44
48
  hasBand: bandEnabled = true,
49
+ insetAfter = 1,
45
50
  proseClass = 'prose prose-lg max-w-none',
46
51
  renderMarkdown,
47
52
  renderInline,
@@ -58,10 +63,17 @@ const tipSlot = clamp(1);
58
63
 
59
64
  const bandSlot = pickBandSlot(body.sections.length, interludes, bandAfter);
60
65
  const hasBand = bandEnabled && Astro.slots.has('band');
61
- const firstSlots = hasBand ? bandSlot + 1 : slotCount;
62
-
63
- const first = Array.from({ length: firstSlots }, (_, i) => i);
64
- const rest = Array.from({ length: slotCount - firstSlots }, (_, i) => firstSlots + i);
66
+ const breaks = [
67
+ ...(hasBand ? [{ at: bandSlot, slot: 'band' }] : []),
68
+ ...(Astro.slots.has('inset') ? [{ at: clamp(insetAfter), slot: 'inset' }] : []),
69
+ ].sort((a, b) => a.at - b.at);
70
+ const range = (from: number, to: number) => Array.from({ length: to - from }, (_, i) => from + i);
71
+ const ends = [...breaks.map((b) => b.at + 1), slotCount];
72
+ const first = range(0, ends[0]);
73
+ // Each break, then the slots up to the next one; the slots after the last break are `rest`.
74
+ const mid = breaks.slice(0, -1).map((b, k) => ({ slot: b.slot, slots: range(ends[k], ends[k + 1]) }));
75
+ const last = breaks.at(-1)?.slot;
76
+ const rest = breaks.length ? range(ends[breaks.length - 1], slotCount) : [];
65
77
  const slotProps = (i: number) => ({
66
78
  index: i,
67
79
  section: i > 0 ? body.sections[i - 1] : undefined,
@@ -81,7 +93,7 @@ const slotProps = (i: number) => ({
81
93
  {first.map((i) => <MonumentBodySlot {...slotProps(i)} />)}
82
94
  </article>
83
95
  </Container>
84
- {hasBand && <slot name="band" />}
96
+ {mid.map((m) => <Fragment>{m.slot === 'band' ? <slot name="band" /> : <slot name="inset" />}{m.slots.length > 0 && <Container size="measure"><article class:list={[proseClass, 'mt-12']} data-pagefind-body>{m.slots.map((i) => <MonumentBodySlot {...slotProps(i)} />)}</article></Container>}</Fragment>)}{last === 'band' ? <slot name="band" /> : last === 'inset' && <slot name="inset" />}
85
97
  {rest.length > 0 && (
86
98
  <Container size="measure">
87
99
  <article class:list={[proseClass, 'mt-12']} data-pagefind-body>
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import { Badge } from '@sarimarcus/content-sites-ui/primitives';
7
7
  import { ContentHero } from '@sarimarcus/content-sites-ui/layout';
8
+ import { heroChip } from './monumentHero.ts';
8
9
 
9
10
  interface Props {
10
11
  name: string;
@@ -14,6 +15,10 @@ interface Props {
14
15
  imagePlaceholder?: string;
15
16
  hours?: string;
16
17
  fees?: string;
18
+ /** Label-length hours for the chip (≤40 chars); without it the chip shows `hours` only when short and unhedged. */
19
+ hoursSummary?: string;
20
+ /** Same rule as `hoursSummary`, for fees. */
21
+ feesSummary?: string;
17
22
  /** Link of the directions chip; the chip is omitted without it. */
18
23
  directionsHref?: string;
19
24
  tags?: string[];
@@ -30,6 +35,8 @@ const {
30
35
  imagePlaceholder,
31
36
  hours,
32
37
  fees,
38
+ hoursSummary,
39
+ feesSummary,
33
40
  directionsHref,
34
41
  tags = [],
35
42
  unescoLabel,
@@ -38,6 +45,8 @@ const {
38
45
  } = Astro.props;
39
46
 
40
47
  const isUNESCO = tags.includes('unesco');
48
+ const hoursChip = heroChip(hoursSummary, hours);
49
+ const feesChip = heroChip(feesSummary, fees);
41
50
  ---
42
51
 
43
52
  <ContentHero
@@ -66,20 +75,20 @@ const isUNESCO = tags.includes('unesco');
66
75
  ))}
67
76
  </Fragment>
68
77
  <Fragment slot="info">
69
- {hours && (
78
+ {hoursChip && (
70
79
  <div class="inline-flex items-center gap-2 px-4 py-2 bg-chalk/95 backdrop-blur-sm rounded-lg text-shadow">
71
80
  <svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
72
81
  <circle cx="12" cy="12" r="10" /><polyline points="12 6 12 12 16 14" />
73
82
  </svg>
74
- <span class="text-sm">{hours.split(',')[0]}</span>
83
+ <span class="text-sm">{hoursChip}</span>
75
84
  </div>
76
85
  )}
77
- {fees && (
86
+ {feesChip && (
78
87
  <div class="inline-flex items-center gap-2 px-4 py-2 bg-chalk/95 backdrop-blur-sm rounded-lg text-shadow">
79
88
  <svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
80
89
  <path d="M4 10h12"/><path d="M4 14h9"/><path d="M19 6a7.7 7.7 0 0 0-5.2-2A7.9 7.9 0 0 0 6 12c0 4.4 3.5 8 7.8 8 2 0 3.8-.8 5.2-2"/>
81
90
  </svg>
82
- <span class="text-sm">{fees}</span>
91
+ <span class="text-sm">{feesChip}</span>
83
92
  </div>
84
93
  )}
85
94
  {directionsHref && (
@@ -0,0 +1,102 @@
1
+ // CountryLocator's layout (SLA-4074): a deterministic projection of country outlines and one pin into a fixed-width
2
+ // SVG. The extent is the home country (plus any disputed area drawn with it), widened just enough to hold a pin that
3
+ // falls outside it, so an entry abroad shows its neighbour next to the home country.
4
+
5
+ export type LocatorRole = 'home' | 'disputed' | 'neighbour';
6
+ export type LngLat = [number, number];
7
+
8
+ export interface LocatorCountry {
9
+ name: string;
10
+ role: LocatorRole;
11
+ /** Outer rings, [lng, lat]. */
12
+ rings: LngLat[][];
13
+ }
14
+
15
+ export interface LocatorShape { name: string; role: LocatorRole; d: string }
16
+
17
+ export interface CountryLocatorLayout {
18
+ width: number;
19
+ height: number;
20
+ shapes: LocatorShape[];
21
+ pin: { x: number; y: number };
22
+ /** The country the pin falls in (nearest outline when it falls in none). */
23
+ country: string;
24
+ /** True when the pin lies outside the home extent and the view was widened. */
25
+ widened: boolean;
26
+ }
27
+
28
+ export interface LocatorOptions {
29
+ width?: number;
30
+ /** Degrees kept around the extent. */
31
+ margin?: number;
32
+ /** Degrees kept around a pin that widens the view, so it never sits on the edge. */
33
+ pinPad?: number;
34
+ }
35
+
36
+ type Box = [number, number, number, number];
37
+
38
+ const boxOf = (pts: LngLat[]): Box => pts.reduce<Box>(
39
+ ([a, b, c, d], [x, y]) => [Math.min(a, x), Math.min(b, y), Math.max(c, x), Math.max(d, y)],
40
+ [Infinity, Infinity, -Infinity, -Infinity],
41
+ );
42
+ const inBox = ([a, b, c, d]: Box, [x, y]: LngLat) => x >= a && x <= c && y >= b && y <= d;
43
+ const overlaps = (p: Box, q: Box) => p[0] <= q[2] && q[0] <= p[2] && p[1] <= q[3] && q[1] <= p[3];
44
+
45
+ function inRing(ring: LngLat[], [x, y]: LngLat): boolean {
46
+ let inside = false;
47
+ for (let i = 0, j = ring.length - 1; i < ring.length; j = i++) {
48
+ const [xi, yi] = ring[i];
49
+ const [xj, yj] = ring[j];
50
+ if ((yi > y) !== (yj > y) && x < ((xj - xi) * (y - yi)) / (yj - yi) + xi) inside = !inside;
51
+ }
52
+ return inside;
53
+ }
54
+
55
+ export function countryAt(countries: LocatorCountry[], point: LngLat): string {
56
+ const hit = countries.find((c) => c.rings.some((r) => inRing(r, point)));
57
+ if (hit) return hit.name;
58
+ let best = { name: '', d: Infinity };
59
+ for (const c of countries) {
60
+ for (const r of c.rings) {
61
+ for (const [x, y] of r) {
62
+ const d = (x - point[0]) ** 2 + (y - point[1]) ** 2;
63
+ if (d < best.d) best = { name: c.name, d };
64
+ }
65
+ }
66
+ }
67
+ return best.name;
68
+ }
69
+
70
+ const round = (n: number) => Math.round(n * 10) / 10;
71
+
72
+ export function countryLocatorLayout(
73
+ countries: LocatorCountry[],
74
+ point: { lat: number; lng: number },
75
+ { width = 240, margin = 0.35, pinPad = 0.6 }: LocatorOptions = {},
76
+ ): CountryLocatorLayout {
77
+ const p: LngLat = [point.lng, point.lat];
78
+ const homeRings = countries.filter((c) => c.role !== 'neighbour').flatMap((c) => c.rings);
79
+ if (!homeRings.length) throw new Error('countryLocatorLayout: no home country');
80
+ const home = boxOf(homeRings.flat());
81
+ const widened = !inBox(home, p);
82
+ const pad = widened ? pinPad : 0;
83
+ const ext = boxOf([[home[0], home[1]], [home[2], home[3]], [p[0] - pad, p[1] - pad], [p[0] + pad, p[1] + pad]]);
84
+ const [x0, y0, x1, y1] = [ext[0] - margin, ext[1] - margin, ext[2] + margin, ext[3] + margin];
85
+ const kx = Math.cos((((y0 + y1) / 2) * Math.PI) / 180);
86
+ const scale = width / ((x1 - x0) * kx);
87
+ const height = Math.round((y1 - y0) * scale);
88
+ const proj = ([x, y]: LngLat) => [round((x - x0) * kx * scale), round((y1 - y) * scale)];
89
+ const view: Box = [x0, y0, x1, y1];
90
+ const order: Record<LocatorRole, number> = { neighbour: 0, home: 1, disputed: 2 };
91
+ const shapes = countries
92
+ .map((c) => ({ c, rings: c.rings.filter((r) => overlaps(boxOf(r), view)) }))
93
+ .filter(({ rings }) => rings.length)
94
+ .sort((a, b) => order[a.c.role] - order[b.c.role])
95
+ .map(({ c, rings }) => ({
96
+ name: c.name,
97
+ role: c.role,
98
+ d: rings.map((r) => `M${r.map((pt) => proj(pt).join(' ')).join('L')}Z`).join(''),
99
+ }));
100
+ const [px, py] = proj(p);
101
+ return { width, height, shapes, pin: { x: px, y: py }, country: countryAt(countries, p), widened };
102
+ }
@@ -15,6 +15,12 @@ export { default as ArticleCardGrid } from './ArticleCardGrid.astro';
15
15
  export type { ArticleCardGridEntry } from './ArticleCardGrid.astro';
16
16
  export { default as RelatedBlock } from './RelatedBlock.astro';
17
17
  export { default as MonumentHero } from './MonumentHero.astro';
18
+ export { heroChip, HERO_CHIP_MAX } from './monumentHero.ts';
19
+ export { default as LocationMap } from './LocationMap.astro';
20
+ export type { LocationMapEngineProps } from './LocationMap.astro';
21
+ export { default as CountryLocator } from './CountryLocator.astro';
22
+ export { countryLocatorLayout, countryAt } from './countryLocator.ts';
23
+ export type { CountryLocatorLayout, LocatorCountry, LocatorRole, LocatorShape } from './countryLocator.ts';
18
24
  export { default as QuartierHero } from './QuartierHero.astro';
19
25
  export { default as ShelfCard } from './ShelfCard.astro';
20
26
  export { default as NeighborhoodShelf } from './NeighborhoodShelf.astro';
@@ -0,0 +1,14 @@
1
+ // MonumentHero's chip rule (SLA-4074): a hero chip is a label, never truncated prose. An explicit summary always wins;
2
+ // without one the full value shows only when it is short and states a fact rather than a hedge.
3
+
4
+ export const HERO_CHIP_MAX = 40;
5
+
6
+ const HEDGE = /\b(check|confirm|not (stated|published|listed)|no (official|fixed|ticket|admission|visiting|general)|varies|variable|subject to|reportedly|unknown|tba|closed to visitors|on request)\b/i;
7
+
8
+ export function heroChip(summary: string | undefined, full: string | undefined, max = HERO_CHIP_MAX): string | undefined {
9
+ const s = summary?.trim();
10
+ if (s) return s;
11
+ const f = full?.trim();
12
+ if (!f || f.length > max || HEDGE.test(f)) return undefined;
13
+ return f;
14
+ }
@@ -0,0 +1,244 @@
1
+ ---
2
+ import { ResponsiveImage } from '@sarimarcus/content-sites-ui/primitives';
3
+ import { CardCarousel } from '@sarimarcus/content-sites-ui/composed';
4
+ import { Container } from '@sarimarcus/content-sites-ui/layout';
5
+ import Mark from '../sections/Mark.astro';
6
+ import type { TourismItinerariesModel } from './tourismItinerariesModel';
7
+
8
+ interface Props { model: TourismItinerariesModel }
9
+ const { model } = Astro.props;
10
+ const { lead, stays, arrivals, trips, routes, plan, faq } = model;
11
+ const routeLead = routes.lead;
12
+ const tourLinks = plan.tours ? await Promise.all(plan.tours.items.map((t) => Astro.slots.render(t.slot))) : [];
13
+ const markKinds = [...new Set(plan.months.flatMap((m) => m.mark ? [m.mark] : []))];
14
+ const showDays = (i: { days?: string; name: string }) => i.days && !i.name.includes(i.days);
15
+ ---
16
+
17
+ <div data-pagefind-ignore>
18
+ <main class="hp hp--thumbs itn">
19
+
20
+ <section class="hp-lead itn-lead" aria-labelledby="itn-h1">
21
+ <Container>
22
+ <div class="hp-lead__top" data-track-zone="hero">
23
+ <div>
24
+ <h1 id="itn-h1">{lead.heading}</h1>
25
+ <p class="hp-lead__stand">{lead.standfirst}</p>
26
+ <p class="itn-also" set:html={lead.also} />
27
+ <p class="hp-lead__links">{lead.links.map((g) => <a href={g.href}>{g.label}</a>)}</p>
28
+ <nav class="hp-jump" aria-label={lead.jumpLabel}>
29
+ <ul role="list">
30
+ {lead.links.map((g) => <li><a href={g.href}>{g.label}</a></li>)}
31
+ </ul>
32
+ </nav>
33
+ <p class="hp-meta itn-byline">{lead.byLabel} <a href={lead.author.href}>{lead.author.label}</a> · {lead.updatedLabel} <time datetime={lead.updated.datetime}>{lead.updated.label}</time> · {lead.checkedLabel} <time datetime={lead.checked.datetime}>{lead.checked.label}</time></p>
34
+ </div>
35
+ <figure class="hp-lead__photo">
36
+ <div>
37
+ <ResponsiveImage src={lead.photo.image} alt={lead.photo.alt} sizes="(min-width: 72rem) 760px, (min-width: 52rem) 64vw, 112vw" loading="eager" fetchpriority="high" />
38
+ </div>
39
+ <figcaption>{lead.photo.caption}</figcaption>
40
+ </figure>
41
+ </div>
42
+
43
+ <section class="hp-ess" id="stays" aria-labelledby="stays-h" data-track-zone="stays">
44
+ <div class="hp-ess__head">
45
+ <h2 id="stays-h">{stays.heading}</h2>
46
+ <p class="hp-meta">{stays.intro}</p>
47
+ </div>
48
+ <ol role="list" class="hp-rank itn-stay">
49
+ {stays.items.map((s) => (
50
+ <li>
51
+ <span class="hp-rank__thumb"><ResponsiveImage src={s.image} alt="" sizes="(min-width: 52rem) 256px, 192px" loading="lazy" /></span>
52
+ <div class="hp-rank__body">
53
+ <h3><a href={s.href}>{s.name}</a></h3>
54
+ {s.text && <p class="hp-rank__why">{s.text}</p>}
55
+ </div>
56
+ <p class="hp-rank__fact">{showDays(s) && <span class="itn-len">{s.days}</span>}{s.budget}</p>
57
+ </li>
58
+ ))}
59
+ </ol>
60
+ </section>
61
+ </Container>
62
+ </section>
63
+
64
+ <section class="hp-band hp-band--muted" id="getting-here" aria-labelledby="arrive-h" data-track-zone="getting-here">
65
+ <Container>
66
+ <div class="hp-head">
67
+ <h2 id="arrive-h">{arrivals.heading}</h2>
68
+ <p>{arrivals.intro}</p>
69
+ </div>
70
+ <table class="hp-cal itn-table" style={`--itn-from-label: ${JSON.stringify(arrivals.fromLabel)}`}>
71
+ <caption>{arrivals.caption}</caption>
72
+ <thead>
73
+ <tr><th scope="col">{arrivals.columns.route}</th><th scope="col">{arrivals.columns.journey}</th><th scope="col">{arrivals.columns.mode}</th><th scope="col">{arrivals.columns.fare}</th></tr>
74
+ </thead>
75
+ <tbody>
76
+ {arrivals.items.map((a) => (
77
+ <tr>
78
+ <th scope="row">
79
+ <span class="hp-cal__ev">
80
+ <span class="hp-cal__thumb"><ResponsiveImage src={a.image} alt="" sizes="(min-width: 40rem) 96px, 152px" loading="lazy" /></span>
81
+ <span class="hp-cal__name"><a href={a.href}>{a.name}</a></span>
82
+ </span>
83
+ </th>
84
+ <td class="hp-when">{a.journey?.duration}</td>
85
+ <td class="hp-where">{a.journey?.mode}{a.journey?.perDay && <>, {a.journey.perDay} {arrivals.perDaySuffix}</>}</td>
86
+ <td class="hp-entry">{a.journey?.fromPrice ?? arrivals.missingFare}</td>
87
+ </tr>
88
+ ))}
89
+ </tbody>
90
+ </table>
91
+ </Container>
92
+ </section>
93
+
94
+ <section class="hp-band" id="day-trips" aria-labelledby="trips-h" data-track-zone="day-trips">
95
+ <Container>
96
+ <div class="hp-head">
97
+ <h2 id="trips-h">{trips.heading}</h2>
98
+ <p>{trips.intro}</p>
99
+ </div>
100
+ <div class="itn-split">
101
+ <ol role="list" class="hp-trips">
102
+ {trips.items.map((t, i) => (
103
+ <li>
104
+ <div class="hp-img"><ResponsiveImage src={t.image} alt="" sizes="160px" loading="lazy" /></div>
105
+ <h3><span class="itn-n" aria-hidden="true">{i + 1}</span><a class="hp-quiet" href={t.href}>{t.name}</a></h3>
106
+ {t.text && <p>{t.text}</p>}
107
+ <span class="hp-meta">{t.journeyMeta}</span>
108
+ </li>
109
+ ))}
110
+ </ol>
111
+ <div class="itn-map" role="region" aria-label={trips.mapLabel}>
112
+ <slot name="map" />
113
+ </div>
114
+ </div>
115
+ </Container>
116
+ </section>
117
+
118
+ <section class="hp-band hp-band--muted" id={routes.id} aria-labelledby={`${routes.id}-h`} data-track-zone={routes.trackZone}>
119
+ <Container>
120
+ <div class="hp-head">
121
+ <h2 id={`${routes.id}-h`}>{routes.heading}</h2>
122
+ <p>{routes.intro}</p>
123
+ </div>
124
+ <div class="hp-feed">
125
+ {routeLead && <article class="hp-feed__lead">
126
+ <div class="hp-img"><ResponsiveImage src={routeLead.image} alt={routeLead.imageAlt} sizes="(min-width: 72rem) 760px, (min-width: 52rem) 58vw, 100vw" loading="lazy" /></div>
127
+ <h3><a href={routeLead.href}>{routeLead.name}</a></h3>
128
+ {routeLead.text && <p class="hp-dek">{routeLead.text}</p>}
129
+ {showDays(routeLead) && <p class="hp-meta">{routeLead.days}</p>}
130
+ </article>}
131
+ <ul role="list" class="hp-feed__list">
132
+ {routes.items.map((r) => (
133
+ <li>
134
+ <div>
135
+ <h3><a href={r.href}>{r.name}</a></h3>
136
+ {r.text && <p>{r.text}</p>}
137
+ {showDays(r) && <p class="hp-meta">{r.days}</p>}
138
+ </div>
139
+ <div class="hp-thumb"><ResponsiveImage src={r.image} alt="" sizes="176px" loading="lazy" /></div>
140
+ </li>
141
+ ))}
142
+ </ul>
143
+ </div>
144
+ </Container>
145
+ </section>
146
+
147
+ <section class="hp-band" id="when" aria-labelledby="plan-h" data-track-zone="plan-your-visit">
148
+ <Container>
149
+ <div class="hp-head">
150
+ <h2 id="plan-h">{plan.heading}</h2>
151
+ </div>
152
+ <div class="hp-plan">
153
+ <div class="hp-plan__main">
154
+ <div class="hp-plan__when">
155
+ <h3>{plan.monthsHeading}</h3>
156
+ <ol role="list" class="hp-months" aria-label={plan.monthsHeading}>
157
+ {plan.months.map((mo) => (
158
+ <li class:list={[{ 'is-peak': mo.peak }]}><a class="hp-quiet" href={mo.href} aria-label={mo.ariaLabel}>{mo.label}{mo.mark && <Mark kind={mo.mark} label={plan.marks[mo.mark]} decorative />}</a></li>
159
+ ))}
160
+ </ol>
161
+ <ul role="list" class="hp-key" aria-label={plan.keyLabel}>
162
+ {markKinds.map((k) => <li><Mark kind={k} decorative />{plan.marks[k]}</li>)}
163
+ </ul>
164
+ <p set:html={plan.note} />
165
+ </div>
166
+ </div>
167
+ {plan.tours && plan.tours.items.length > 0 && (
168
+ <aside class="hp-tours" aria-labelledby="tours-h" data-track-zone="activities">
169
+ <h3 id="tours-h">{plan.tours.heading}</h3>
170
+ <slot name="tour-disclosure" />
171
+ <CardCarousel staticFrom="base" ariaLabel={plan.tours.heading} trackClass="itn-tours">
172
+ {plan.tours.items.map((t, i) => (
173
+ <div>
174
+ <Fragment set:html={tourLinks[i]} />
175
+ <span class="hp-meta">{t.meta}</span>
176
+ </div>
177
+ ))}
178
+ </CardCarousel>
179
+ <a class="hp-more" href={plan.tours.more.href}>{plan.tours.more.label}</a>
180
+ </aside>
181
+ )}
182
+ </div>
183
+ </Container>
184
+ </section>
185
+
186
+ <section class="hp-band hp-band--muted" aria-labelledby="qa-h" data-track-zone="faq">
187
+ <Container>
188
+ <div class="hp-head">
189
+ <h2 id="qa-h">{faq.heading}</h2>
190
+ </div>
191
+ <dl class="hp-qa">
192
+ {faq.items.map((q) => (
193
+ <div>
194
+ <dt>{q.question}</dt>
195
+ <dd set:html={q.answer} />
196
+ </div>
197
+ ))}
198
+ </dl>
199
+ </Container>
200
+ </section>
201
+
202
+ </main>
203
+ </div>
204
+
205
+ <style>
206
+ .hp.itn .itn-lead { padding-top: clamp(2rem, 5vw, 3.5rem); }
207
+ .hp .itn-also { margin-top: 0.75rem; font-size: 0.9375rem; color: var(--muted-foreground); }
208
+ .hp .itn-byline { margin-top: 1.25rem; }
209
+ .hp .hp-plan__when .hp-key { margin-bottom: 1rem; }
210
+ .hp :global(.itn-tours) > div { padding-block: 0.75rem; border-top: var(--hp-rule); display: grid; gap: 0.125rem; }
211
+ .hp :global(.itn-tours a) { font-weight: 600; }
212
+
213
+ .hp .itn-stay > li { grid-template-columns: 6rem minmax(0, 1fr); gap: 0 1rem; }
214
+ .hp .itn-stay .hp-rank__thumb { grid-column: 1; grid-row: 1 / span 2; width: 6rem; height: 4.5rem; }
215
+ .hp .itn-stay .hp-rank__body { grid-column: 2; }
216
+ .hp .itn-stay .hp-rank__fact { grid-column: 2; grid-row: 2; color: var(--foreground); font-variant-numeric: tabular-nums; }
217
+ .hp .itn-len { display: block; font-family: var(--font-display); font-size: 1.25rem; line-height: 1.2; color: var(--primary-strong); }
218
+
219
+ .hp .itn-table td.hp-entry::before { content: none; }
220
+ .hp .itn-table td.hp-entry { white-space: nowrap; font-variant-numeric: tabular-nums; }
221
+
222
+ .hp .itn-split { display: grid; gap: 2rem; }
223
+ .hp .itn-n { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; margin-right: 0.5rem; border-radius: 50%; background: var(--primary-strong); color: var(--background); font-family: var(--font-body); font-size: 0.75rem; font-weight: 600; vertical-align: 0.15em; }
224
+ .hp .hp-trips .hp-meta { display: block; margin-top: 0.375rem; }
225
+ .hp .hp-trips > li > .hp-img { display: none; }
226
+
227
+ @media (max-width: 39.99rem) {
228
+ .hp .itn-table td.hp-entry::before { content: var(--itn-from-label); color: var(--muted-foreground); }
229
+ .hp .itn-table caption { display: block; padding: 0 0 1rem; background: var(--muted); }
230
+ .hp .itn-table .hp-cal__name { grid-row: 1; }
231
+ .hp .itn-table td.hp-when { grid-row: 2; }
232
+ }
233
+ @media (min-width: 40rem) {
234
+ .hp .hp-trips > li > .hp-img { display: block; }
235
+ .hp .itn-table td.hp-entry, .hp .itn-table thead th:last-child { text-align: right; }
236
+ }
237
+ @media (min-width: 52rem) {
238
+ .hp .itn-stay > li { grid-template-columns: 8rem minmax(0, 1fr) 14rem; gap: 0 1.5rem; }
239
+ .hp .itn-stay .hp-rank__thumb { grid-row: 1; width: 8rem; height: 6rem; }
240
+ .hp .itn-stay .hp-rank__fact { grid-column: 3; grid-row: 1; text-align: right; }
241
+ .hp .itn-split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
242
+ .hp .itn-map { position: sticky; top: 6rem; }
243
+ }
244
+ </style>
@@ -0,0 +1,2 @@
1
+ export { default as TourismItinerariesHub } from './TourismItinerariesHub.astro';
2
+ export type { TourismItinerariesModel, HubItinerary } from './tourismItinerariesModel';
@@ -0,0 +1,56 @@
1
+ import type { ImageMetadata } from 'astro';
2
+ import type { HomeHead, HomeLink, HomeMonth } from './tourismHomeModel';
3
+ import type { MarkLabels } from '../sections/marks';
4
+
5
+ export interface HubItinerary {
6
+ name: string;
7
+ href: string;
8
+ image: ImageMetadata;
9
+ imageAlt: string;
10
+ text?: string;
11
+ days?: string;
12
+ budget?: string;
13
+ journey?: { mode: string; duration: string; fromPrice?: string; perDay?: string };
14
+ journeyMeta?: string;
15
+ }
16
+
17
+ export interface TourismItinerariesModel {
18
+ lead: {
19
+ heading: string;
20
+ standfirst: string;
21
+ /** HTML. */
22
+ also: string;
23
+ links: HomeLink[];
24
+ jumpLabel: string;
25
+ photo: { image: ImageMetadata; alt: string; caption: string };
26
+ author: HomeLink;
27
+ byLabel: string;
28
+ updatedLabel: string;
29
+ updated: { datetime: string; label: string };
30
+ checkedLabel: string;
31
+ checked: { datetime: string; label: string };
32
+ };
33
+ stays: HomeHead & { items: HubItinerary[] };
34
+ arrivals: HomeHead & {
35
+ caption: string;
36
+ columns: { route: string; journey: string; mode: string; fare: string };
37
+ perDaySuffix: string;
38
+ missingFare: string;
39
+ fromLabel: string;
40
+ items: HubItinerary[];
41
+ };
42
+ trips: HomeHead & { mapLabel: string; items: HubItinerary[] };
43
+ routes: HomeHead & { id: string; trackZone: string; lead?: HubItinerary; items: HubItinerary[] };
44
+ plan: {
45
+ heading: string;
46
+ monthsHeading: string;
47
+ months: HomeMonth[];
48
+ marks: MarkLabels;
49
+ keyLabel: string;
50
+ /** HTML. */
51
+ note: string;
52
+ /** Each named slot contains the site's affiliate link, followed by its meta. */
53
+ tours?: { heading: string; items: { slot: string; meta: string }[]; more: HomeLink };
54
+ };
55
+ faq: { heading: string; items: { question: string; /** HTML. */ answer: string }[] };
56
+ }