@sarimarcus/content-sites-tourism 0.65.0 → 0.67.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 +16 -0
- package/package.json +3 -3
- package/src/sections/CountryLocator.astro +35 -0
- package/src/sections/LocationMap.astro +47 -0
- package/src/sections/MonumentBody.astro +17 -5
- package/src/sections/MonumentHero.astro +13 -4
- package/src/sections/countryLocator.ts +102 -0
- package/src/sections/index.ts +6 -0
- package/src/sections/monumentHero.ts +14 -0
- package/src/templates/TourismHomePage.astro +10 -7
- package/src/templates/home.css +2 -1
- package/src/templates/tourismHomeModel.ts +2 -1
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.67.0 (2026-11-12)
|
|
6
|
+
|
|
7
|
+
Additive (SLA-4074).
|
|
8
|
+
|
|
9
|
+
- `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`.
|
|
10
|
+
- 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.
|
|
11
|
+
- 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).
|
|
12
|
+
- `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.
|
|
13
|
+
|
|
14
|
+
## 0.66.0 (2026-11-12)
|
|
15
|
+
|
|
16
|
+
Additive.
|
|
17
|
+
|
|
18
|
+
- `TourismHomePage` food band: at desktop width (52rem+) the dish list takes 8 of 12 columns (was 7) and the feature figure 4 (was 5); dish thumbnails grow from 5rem to 7rem (image `sizes` 224px).
|
|
19
|
+
- `food.more` (`HomeLink`, optional) renders an `hp-more` link under the dishes, like the other sections; `food.wheres` is now optional.
|
|
20
|
+
|
|
5
21
|
## 0.65.0 (2026-11-12)
|
|
6
22
|
|
|
7
23
|
Additive.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sarimarcus/content-sites-tourism",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.67.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",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"astro": "^7.0.6",
|
|
40
40
|
"tailwindcss": "^4.1.18",
|
|
41
|
-
"@sarimarcus/content-sites-core": "0.
|
|
42
|
-
"@sarimarcus/content-sites-ui": "0.
|
|
41
|
+
"@sarimarcus/content-sites-core": "0.67.0",
|
|
42
|
+
"@sarimarcus/content-sites-ui": "0.67.0"
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -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
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
{
|
|
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
|
-
{
|
|
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">{
|
|
83
|
+
<span class="text-sm">{hoursChip}</span>
|
|
75
84
|
</div>
|
|
76
85
|
)}
|
|
77
|
-
{
|
|
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">{
|
|
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
|
+
}
|
package/src/sections/index.ts
CHANGED
|
@@ -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
|
+
}
|
|
@@ -356,17 +356,20 @@ const showEntry = Boolean(events?.columns.entry);
|
|
|
356
356
|
<CardCarousel staticFrom="sm" ariaLabel={food.carouselAriaLabel} trackClass="hp-dishes hp-swipe" locale={locale}>
|
|
357
357
|
{food.dishes.map((d) => (
|
|
358
358
|
<div>
|
|
359
|
-
<div class="hp-img hp-m-only">{d.image && <ResponsiveImage src={d.image} alt="" sizes="(min-width: 40rem)
|
|
359
|
+
<div class="hp-img hp-m-only">{d.image && <ResponsiveImage src={d.image} alt="" sizes="(min-width: 40rem) 224px, 82vw" loading="lazy" />}</div>
|
|
360
360
|
<a href={d.href}>{d.name}</a><p class="hp-soft">{d.line}</p>
|
|
361
361
|
</div>
|
|
362
362
|
))}
|
|
363
363
|
</CardCarousel>
|
|
364
|
-
<
|
|
365
|
-
|
|
366
|
-
<
|
|
367
|
-
{food.wheres.
|
|
368
|
-
|
|
369
|
-
|
|
364
|
+
{food.more && <a class="hp-more" href={food.more.href}>{food.more.label}</a>}
|
|
365
|
+
{food.wheres && (
|
|
366
|
+
<div class="hp-wheres">
|
|
367
|
+
<h3>{food.wheres.heading}</h3>
|
|
368
|
+
<ul>
|
|
369
|
+
{food.wheres.items.map((html, i) => <>{i > 0 && ' '}<li set:html={html} /></>)}
|
|
370
|
+
</ul>
|
|
371
|
+
</div>
|
|
372
|
+
)}
|
|
370
373
|
</div>
|
|
371
374
|
</div>
|
|
372
375
|
</Container>
|
package/src/templates/home.css
CHANGED
|
@@ -285,7 +285,7 @@
|
|
|
285
285
|
.hp .hp-plan { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
|
|
286
286
|
.hp .hp-feed { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
|
|
287
287
|
.hp .hp-quarters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
|
288
|
-
.hp .hp-food { grid-template-columns: minmax(0,
|
|
288
|
+
.hp .hp-food { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); align-items: start; }
|
|
289
289
|
.hp .hp-food__fig { position: sticky; top: 6rem; }
|
|
290
290
|
.hp .hp-dishes { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; }
|
|
291
291
|
.hp .hp-out { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
@@ -314,6 +314,7 @@
|
|
|
314
314
|
}
|
|
315
315
|
.hp.hp--thumbs :is(.hp-tours .hp-swipe, .hp-walks, .hp-trips, .hp-dishes) > *:has(> .hp-img:not(:empty)) > :not(.hp-img) { grid-column: 2; }
|
|
316
316
|
.hp.hp--thumbs .hp-walks .hp-meta { white-space: normal; }
|
|
317
|
+
.hp.hp--thumbs .hp-food .hp-dishes > *:has(> .hp-img:not(:empty)) { grid-template-columns: 7rem minmax(0, 1fr); }
|
|
317
318
|
}
|
|
318
319
|
|
|
319
320
|
/* small screens */
|
|
@@ -99,7 +99,8 @@ export interface TourismHomeModel {
|
|
|
99
99
|
/** `href` links the caption to the featured dish. */
|
|
100
100
|
feature: { image?: ImageMetadata; alt: string; caption: string; href?: string };
|
|
101
101
|
dishes: HomeDish[];
|
|
102
|
-
wheres
|
|
102
|
+
wheres?: { heading: string; /** Each an HTML string. */ items: string[] };
|
|
103
|
+
more?: HomeLink;
|
|
103
104
|
};
|
|
104
105
|
stay: HomeHead & {
|
|
105
106
|
carouselAriaLabel: string;
|