@sarimarcus/content-sites-tourism 0.71.0 → 0.73.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 +26 -0
- package/package.json +3 -3
- package/src/schema/builders.ts +39 -0
- package/src/schema/index.ts +1 -1
- package/src/templates/ItnChecked.astro +7 -0
- package/src/templates/TourismItinerariesHub.astro +117 -30
- package/src/templates/TourismMonthGuide.astro +11 -3
- package/src/templates/itineraries.ts +4 -1
- package/src/templates/tourismItinerariesModel.ts +123 -9
- package/src/templates/tourismMonthGuideModel.ts +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
All packages in the platform release in lockstep; entries are per release version.
|
|
4
4
|
|
|
5
|
+
## 0.73.0 (2026-11-15)
|
|
6
|
+
|
|
7
|
+
Additive (SLA-4156). No codemod.
|
|
8
|
+
|
|
9
|
+
- `TourismItinerariesHub` gains an opt-in unified layout, on when the model sets `toc`: the ui `TableOfContents` after the hero (entries from `itinerariesToc`, one per section that renders), `lead.intro`, a `compare` table (stays with a `compare` row; a table from 40rem, stacked cards below), `styles` cards, model-driven `tips` (ui `InsiderTips`), `sources` (ui `AuthoritativeSources`, `domainClass` keeps the Rule 38 rel handling) and `alsoExplore` (ui `AlsoExplore`). Every section head can carry a `checked` date and a shorter `tocLabel`; an item with a `slug` gets a `<section>-<slug>` row anchor. Day trips render without the map column when the `map` slot is empty.
|
|
10
|
+
- `lead.links` is deprecated (Removed in 0.75.0), and the `toc`, `tips`, `faq`, `after-*` slots are ignored once `toc` is set. Without `toc` the markup is unchanged except the model FAQ section's new `id="faq"`.
|
|
11
|
+
- JSON-LD: `itinerariesHubBuilder()` (`./schema`, an ItemList of one TouristTrip per stay, its `itinerary` the stay's covered highlights) and `itinerariesJsonLd(model)` (`./templates/itineraries`, the hub entry plus a `faqPage` entry). A site registers the builder as `itinerariesHub` in its schema policy.
|
|
12
|
+
- Unit tests `tests/run-tourism-itineraries-model-unit.mjs`; render-diff case `tests/fixtures/render-diff/sla-4156-itineraries-unified.json`. Proof: 6 sites, astro check 0 errors, html identical except the differences below.
|
|
13
|
+
|
|
14
|
+
### Intended output changes
|
|
15
|
+
|
|
16
|
+
- `html:itineraries.html` — the model FAQ section carries `id="faq"` (Córdoba); the hub stylesheet, grown past the inline limit, moves from an inline `<style>` to a linked file (all three tourism sites).
|
|
17
|
+
- `css:added` — the unified layout's rules (`.itn-compare`, `.itn-styles`, `.itn-intro`, `.itn-answer`, `.itn-pick`, `.itn-checked`, `.itn-sr`, `.itn-split--solo`).
|
|
18
|
+
- `turism-cadiz-en=html:guides/best-breakfast-cafes-cadiz.html`, `turism-cadiz-en=seo.jsonld` — not this release: the guide has no dates, so its JSON-LD carries the build time and differs on every build.
|
|
19
|
+
|
|
20
|
+
## 0.72.0 (2026-11-14)
|
|
21
|
+
|
|
22
|
+
Additive (SLA-4204).
|
|
23
|
+
|
|
24
|
+
- `TourismMonthGuide` event rows render optional `highlights` (a list) and `tips` from `MonthEventRow`; `events.tipLabel` prefixes a row tip. A row carrying either wraps its name in a `<div>` instead of the `<span>`; rows without them render byte-identical. No codemod.
|
|
25
|
+
- Render-diff case `tests/fixtures/render-diff/sla-4204-month-event-rows.json`. Proof: 3 tourism sites passed, html identical on every page.
|
|
26
|
+
|
|
27
|
+
### Intended output changes
|
|
28
|
+
|
|
29
|
+
- `css:added` — three rules for the event highlights list and tip (`.mg-ev-hl`, `.mg-ev-tip`).
|
|
30
|
+
|
|
5
31
|
## 0.71.0 (2026-11-14)
|
|
6
32
|
|
|
7
33
|
Additive (SLA-4167).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sarimarcus/content-sites-tourism",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.73.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",
|
|
@@ -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.
|
|
44
|
-
"@sarimarcus/content-sites-ui": "0.
|
|
43
|
+
"@sarimarcus/content-sites-core": "0.73.0",
|
|
44
|
+
"@sarimarcus/content-sites-ui": "0.73.0"
|
|
45
45
|
}
|
|
46
46
|
}
|
package/src/schema/builders.ts
CHANGED
|
@@ -215,3 +215,42 @@ export function guideItemListBuilder(options: { city: TourismCity }): SchemaBuil
|
|
|
215
215
|
};
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
+
|
|
219
|
+
const siteHref = (ctx: { siteUrl: string }, href: string) => (href.startsWith('/') ? `${ctx.siteUrl}${href}` : href);
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* The /itineraries hub: an ItemList of one TouristTrip per stay, its `itinerary` the highlights the stay covers.
|
|
223
|
+
* `data` is `itinerariesJsonLd(model)`'s hub entry; hrefs are already base-path resolved, so only the origin is added.
|
|
224
|
+
*/
|
|
225
|
+
export function itinerariesHubBuilder(): SchemaBuilder {
|
|
226
|
+
return (data, ctx) => {
|
|
227
|
+
const stays: any[] = data.stays || [];
|
|
228
|
+
if (!stays.length) return null;
|
|
229
|
+
return {
|
|
230
|
+
'@type': 'ItemList',
|
|
231
|
+
name: data.name,
|
|
232
|
+
...(data.description && { description: data.description }),
|
|
233
|
+
url: ctx.pageUrl,
|
|
234
|
+
numberOfItems: stays.length,
|
|
235
|
+
itemListElement: stays.map((s, i) => ({
|
|
236
|
+
'@type': 'ListItem',
|
|
237
|
+
position: i + 1,
|
|
238
|
+
item: {
|
|
239
|
+
'@type': 'TouristTrip',
|
|
240
|
+
name: s.name,
|
|
241
|
+
url: siteHref(ctx, s.href),
|
|
242
|
+
...(s.description && { description: s.description }),
|
|
243
|
+
...(s.covers?.length && {
|
|
244
|
+
itinerary: {
|
|
245
|
+
'@type': 'ItemList',
|
|
246
|
+
numberOfItems: s.covers.length,
|
|
247
|
+
itemListElement: s.covers.map((name: string, j: number) => ({
|
|
248
|
+
'@type': 'ListItem', position: j + 1, item: { '@type': 'TouristAttraction', name },
|
|
249
|
+
})),
|
|
250
|
+
},
|
|
251
|
+
}),
|
|
252
|
+
},
|
|
253
|
+
})),
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
}
|
package/src/schema/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Public surface of @sarimarcus/content-sites-tourism/schema: city-entity JSON-LD builders on core `schema`.
|
|
2
2
|
export { cityAddressPolicy, cityDestinationFields, cityEventPolicy, organization } from './city.ts';
|
|
3
3
|
export type { TourismCity, CityEventOptions } from './city.ts';
|
|
4
|
-
export { guideItemListBuilder, touristTripBuilder, tourismCityBuilders } from './builders.ts';
|
|
4
|
+
export { guideItemListBuilder, itinerariesHubBuilder, touristTripBuilder, tourismCityBuilders } from './builders.ts';
|
|
5
5
|
export type { TouristTripOptions } from './builders.ts';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { HubChecked } from './tourismItinerariesModel';
|
|
3
|
+
|
|
4
|
+
interface Props { checked?: HubChecked }
|
|
5
|
+
const { checked } = Astro.props;
|
|
6
|
+
---
|
|
7
|
+
{checked && <p class="hp-meta itn-checked">{checked.label} <time datetime={checked.datetime}>{checked.display}</time></p>}
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
---
|
|
2
2
|
import { ResponsiveImage } from '@sarimarcus/content-sites-ui/primitives';
|
|
3
|
-
import { CardCarousel } from '@sarimarcus/content-sites-ui/composed';
|
|
3
|
+
import { CardCarousel, TableOfContents } from '@sarimarcus/content-sites-ui/composed';
|
|
4
|
+
import { AlsoExplore, InsiderTips } from '@sarimarcus/content-sites-ui/editorial';
|
|
5
|
+
import { AuthoritativeSources } from '@sarimarcus/content-sites-ui/seo';
|
|
4
6
|
import { Container } from '@sarimarcus/content-sites-ui/layout';
|
|
5
7
|
import MonthStripNav from './MonthStripNav.astro';
|
|
6
|
-
import
|
|
8
|
+
import ItnChecked from './ItnChecked.astro';
|
|
9
|
+
import { compareRows, itinerariesToc, rowId, type TourismItinerariesModel } from './tourismItinerariesModel';
|
|
7
10
|
|
|
8
11
|
interface Props { model: TourismItinerariesModel }
|
|
9
12
|
const { model } = Astro.props;
|
|
10
|
-
const { lead, stays, arrivals, trips, routes, plan, faq } = model;
|
|
13
|
+
const { lead, stays, compare, styles, arrivals, trips, routes, plan, tips: tipsModel, faq, sources, alsoExplore } = model;
|
|
14
|
+
const unified = !!model.toc;
|
|
15
|
+
const tocItems = unified ? itinerariesToc(model) : [];
|
|
16
|
+
const rows = compareRows(model);
|
|
17
|
+
const hasMap = Astro.slots.has('map');
|
|
11
18
|
const routeLead = routes.lead;
|
|
12
19
|
const tourLinks = plan?.tours ? await Promise.all(plan.tours.items.map((t) => Astro.slots.render(t.slot))) : [];
|
|
13
20
|
const showDays = (i: { days?: string; name: string }) => i.days && !i.name.includes(i.days);
|
|
14
|
-
const slotHtml = async (name: string) => (Astro.slots.has(name) ? (await Astro.slots.render(name)).trim() : '');
|
|
21
|
+
const slotHtml = async (name: string) => (!unified && Astro.slots.has(name) ? (await Astro.slots.render(name)).trim() : '');
|
|
15
22
|
const [toc, tips, faqHtml, afterFaq] = await Promise.all(['toc', 'tips', 'faq', 'after-faq'].map(slotHtml));
|
|
16
23
|
---
|
|
17
24
|
|
|
@@ -23,14 +30,14 @@ const [toc, tips, faqHtml, afterFaq] = await Promise.all(['toc', 'tips', 'faq',
|
|
|
23
30
|
<div class="hp-lead__top" data-track-zone="hero">
|
|
24
31
|
<div>
|
|
25
32
|
<h1 id="itn-h1">{lead.heading}</h1>
|
|
26
|
-
<p class="hp-lead__stand">{lead.standfirst}</p>
|
|
33
|
+
<p class="hp-lead__stand">{lead.standfirst}</p>{lead.intro && <div class="itn-intro" set:html={lead.intro} />}
|
|
27
34
|
{lead.also && <p class="itn-also" set:html={lead.also} />}
|
|
28
|
-
<p class="hp-lead__links">{lead.links.map((g) => <a href={g.href}>{g.label}</a>)}</p>
|
|
35
|
+
{!unified && lead.links && <p class="hp-lead__links">{lead.links.map((g) => <a href={g.href}>{g.label}</a>)}</p>
|
|
29
36
|
<nav class="hp-jump" aria-label={lead.jumpLabel}>
|
|
30
37
|
<ul role="list">
|
|
31
38
|
{lead.links.map((g) => <li><a href={g.href}>{g.label}</a></li>)}
|
|
32
39
|
</ul>
|
|
33
|
-
</nav>
|
|
40
|
+
</nav>}
|
|
34
41
|
<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.checked && <> · {lead.checkedLabel} <time datetime={lead.checked.datetime}>{lead.checked.label}</time></>}</p>
|
|
35
42
|
</div>
|
|
36
43
|
<figure class="hp-lead__photo">
|
|
@@ -39,16 +46,14 @@ const [toc, tips, faqHtml, afterFaq] = await Promise.all(['toc', 'tips', 'faq',
|
|
|
39
46
|
</div>
|
|
40
47
|
{lead.photo.caption && <figcaption>{lead.photo.caption}</figcaption>}
|
|
41
48
|
</figure>
|
|
42
|
-
</div>
|
|
43
|
-
|
|
44
|
-
<section class="hp-ess" id="stays" aria-labelledby="stays-h" data-track-zone="stays">
|
|
49
|
+
</div> {model.toc && tocItems.length > 0 && <div class="itn-toc hp-embed"><TableOfContents items={tocItems} title={model.toc.title} ariaLabel={model.toc.ariaLabel} stickyLabel={model.toc.stickyLabel} locale={model.toc.locale} jumpLabel={lead.jumpLabel} /></div>}<section class="hp-ess" id="stays" aria-labelledby="stays-h" data-track-zone="stays">
|
|
45
50
|
<div class="hp-ess__head">
|
|
46
51
|
<h2 id="stays-h">{stays.heading}</h2>
|
|
47
|
-
<p class="hp-meta">{stays.intro}</p
|
|
52
|
+
<p class="hp-meta">{stays.intro}</p><ItnChecked checked={stays.checked} />
|
|
48
53
|
</div>
|
|
49
54
|
<ol role="list" class="hp-rank itn-stay">
|
|
50
55
|
{stays.items.map((s) => (
|
|
51
|
-
<li>
|
|
56
|
+
<li id={rowId('stay', s)}>
|
|
52
57
|
{s.image && <span class="hp-rank__thumb"><ResponsiveImage src={s.image} alt="" sizes="(min-width: 52rem) 256px, 192px" loading="lazy" /></span>}
|
|
53
58
|
<div class="hp-rank__body">
|
|
54
59
|
<h3><a href={s.href}>{s.name}</a></h3>
|
|
@@ -60,13 +65,62 @@ const [toc, tips, faqHtml, afterFaq] = await Promise.all(['toc', 'tips', 'faq',
|
|
|
60
65
|
</ol>
|
|
61
66
|
</section>
|
|
62
67
|
</Container>
|
|
63
|
-
</section>{toc && <div class="itn-toc"><Container><Fragment set:html={toc} /></Container></div>}
|
|
68
|
+
</section>{!unified && toc && <div class="itn-toc"><Container><Fragment set:html={toc} /></Container></div>}{compare && rows.length > 0 && (
|
|
69
|
+
<section class="hp-band hp-band--muted" id="compare" aria-labelledby="compare-h" data-track-zone="compare">
|
|
70
|
+
<Container>
|
|
71
|
+
<div class="hp-head">
|
|
72
|
+
<h2 id="compare-h">{compare.heading}</h2>
|
|
73
|
+
{compare.intro && <p>{compare.intro}</p>}
|
|
74
|
+
<ItnChecked checked={compare.checked} />
|
|
75
|
+
</div>
|
|
76
|
+
{compare.answer && <p class="itn-answer" set:html={compare.answer} />}
|
|
77
|
+
<table class="itn-compare">
|
|
78
|
+
<caption>{compare.caption}</caption>
|
|
79
|
+
<thead>
|
|
80
|
+
<tr><th scope="col">{compare.columns.itinerary}</th><th scope="col">{compare.columns.days}</th><th scope="col">{compare.columns.pace}</th><th scope="col">{compare.columns.bestFor}</th>{compare.highlights.map((h) => <th scope="col" class="itn-check">{h}</th>)}</tr>
|
|
81
|
+
</thead>
|
|
82
|
+
<tbody>
|
|
83
|
+
{rows.map((r) => (
|
|
84
|
+
<tr id={rowId('compare', r)} data-pick={r.compare.pick ? 'true' : undefined}>
|
|
85
|
+
<th scope="row"><a href={r.href}>{r.name}</a>{r.compare.pick && <span class="itn-pick">{compare.pickLabel}</span>}</th>
|
|
86
|
+
<td data-label={compare.columns.days}>{r.days}</td>
|
|
87
|
+
<td data-label={compare.columns.pace}>{r.compare.pace}</td>
|
|
88
|
+
<td data-label={compare.columns.bestFor}>{r.compare.bestFor}</td>
|
|
89
|
+
{compare.highlights.map((h) => {
|
|
90
|
+
const yes = r.compare.covers.includes(h);
|
|
91
|
+
return <td class="itn-check" data-label={h} data-included={yes ? 'true' : 'false'}><span aria-hidden="true">{yes ? '✓' : '–'}</span><span class="itn-sr">{yes ? compare.includedLabel : compare.notIncludedLabel}</span></td>;
|
|
92
|
+
})}
|
|
93
|
+
</tr>
|
|
94
|
+
))}
|
|
95
|
+
</tbody>
|
|
96
|
+
</table>
|
|
97
|
+
</Container>
|
|
98
|
+
</section>
|
|
99
|
+
)}{styles && styles.items.length > 0 && (
|
|
100
|
+
<section class="hp-band" id="styles" aria-labelledby="styles-h" data-track-zone="styles">
|
|
101
|
+
<Container>
|
|
102
|
+
<div class="hp-head">
|
|
103
|
+
<h2 id="styles-h">{styles.heading}</h2>
|
|
104
|
+
{styles.intro && <p>{styles.intro}</p>}
|
|
105
|
+
<ItnChecked checked={styles.checked} />
|
|
106
|
+
</div>
|
|
107
|
+
<ul role="list" class="itn-styles">
|
|
108
|
+
{styles.items.map((s) => (
|
|
109
|
+
<li id={rowId('style', s)}>
|
|
110
|
+
<h3><a href={s.href}>{s.name}</a></h3>
|
|
111
|
+
<p>{s.text}</p>
|
|
112
|
+
</li>
|
|
113
|
+
))}
|
|
114
|
+
</ul>
|
|
115
|
+
</Container>
|
|
116
|
+
</section>
|
|
117
|
+
)}{!unified && <slot name="after-lead" />}
|
|
64
118
|
{arrivals && (
|
|
65
119
|
<section class="hp-band hp-band--muted" id="getting-here" aria-labelledby="arrive-h" data-track-zone="getting-here">
|
|
66
120
|
<Container>
|
|
67
121
|
<div class="hp-head">
|
|
68
122
|
<h2 id="arrive-h">{arrivals.heading}</h2>
|
|
69
|
-
<p>{arrivals.intro}</p
|
|
123
|
+
<p>{arrivals.intro}</p><ItnChecked checked={arrivals.checked} />
|
|
70
124
|
</div>
|
|
71
125
|
<table class="hp-cal itn-table" style={`--itn-from-label: ${JSON.stringify(arrivals.fromLabel)}`}>
|
|
72
126
|
<caption>{arrivals.caption}</caption>
|
|
@@ -75,7 +129,7 @@ const [toc, tips, faqHtml, afterFaq] = await Promise.all(['toc', 'tips', 'faq',
|
|
|
75
129
|
</thead>
|
|
76
130
|
<tbody>
|
|
77
131
|
{arrivals.items.map((a) => (
|
|
78
|
-
<tr>
|
|
132
|
+
<tr id={rowId('arrival', a)}>
|
|
79
133
|
<th scope="row">
|
|
80
134
|
<span class="hp-cal__ev">
|
|
81
135
|
{a.image && <span class="hp-cal__thumb"><ResponsiveImage src={a.image} alt="" sizes="(min-width: 40rem) 96px, 152px" loading="lazy" /></span>}
|
|
@@ -91,18 +145,18 @@ const [toc, tips, faqHtml, afterFaq] = await Promise.all(['toc', 'tips', 'faq',
|
|
|
91
145
|
</table>
|
|
92
146
|
</Container>
|
|
93
147
|
</section>
|
|
94
|
-
)}<slot name="after-arrivals" />
|
|
148
|
+
)}{!unified && <slot name="after-arrivals" />}
|
|
95
149
|
{trips && (
|
|
96
150
|
<section class="hp-band" id="day-trips" aria-labelledby="trips-h" data-track-zone="day-trips">
|
|
97
151
|
<Container>
|
|
98
152
|
<div class="hp-head">
|
|
99
153
|
<h2 id="trips-h">{trips.heading}</h2>
|
|
100
|
-
<p>{trips.intro}</p
|
|
154
|
+
<p>{trips.intro}</p><ItnChecked checked={trips.checked} />
|
|
101
155
|
</div>
|
|
102
|
-
<div class=
|
|
156
|
+
<div class:list={['itn-split', !hasMap && 'itn-split--solo']}>
|
|
103
157
|
<ol role="list" class="hp-trips">
|
|
104
158
|
{trips.items.map((t, i) => (
|
|
105
|
-
<li>
|
|
159
|
+
<li id={rowId('trip', t)}>
|
|
106
160
|
{t.image && <div class="hp-img"><ResponsiveImage src={t.image} alt="" sizes="160px" loading="lazy" /></div>}
|
|
107
161
|
<h3><span class="itn-n" aria-hidden="true">{i + 1}</span><a class="hp-quiet" href={t.href}>{t.name}</a></h3>
|
|
108
162
|
{t.text && <p>{t.text}</p>}
|
|
@@ -110,22 +164,22 @@ const [toc, tips, faqHtml, afterFaq] = await Promise.all(['toc', 'tips', 'faq',
|
|
|
110
164
|
</li>
|
|
111
165
|
))}
|
|
112
166
|
</ol>
|
|
113
|
-
<div class="itn-map" role="region" aria-label={trips.mapLabel}>
|
|
167
|
+
{hasMap && <div class="itn-map" role="region" aria-label={trips.mapLabel}>
|
|
114
168
|
<slot name="map" />
|
|
115
|
-
</div>
|
|
169
|
+
</div>}
|
|
116
170
|
</div>
|
|
117
171
|
</Container>
|
|
118
172
|
</section>
|
|
119
|
-
)}<slot name="after-trips" />
|
|
173
|
+
)}{!unified && <slot name="after-trips" />}
|
|
120
174
|
|
|
121
175
|
<section class="hp-band hp-band--muted" id={routes.id} aria-labelledby={`${routes.id}-h`} data-track-zone={routes.trackZone}>
|
|
122
176
|
<Container>
|
|
123
177
|
<div class="hp-head">
|
|
124
178
|
<h2 id={`${routes.id}-h`}>{routes.heading}</h2>
|
|
125
|
-
<p>{routes.intro}</p
|
|
179
|
+
<p>{routes.intro}</p><ItnChecked checked={routes.checked} />
|
|
126
180
|
</div>
|
|
127
181
|
<div class="hp-feed">
|
|
128
|
-
{routeLead && <article class="hp-feed__lead">
|
|
182
|
+
{routeLead && <article class="hp-feed__lead" id={rowId('route', routeLead)}>
|
|
129
183
|
{routeLead.image && <div class="hp-img"><ResponsiveImage src={routeLead.image} alt={routeLead.imageAlt} sizes="(min-width: 72rem) 760px, (min-width: 52rem) 58vw, 100vw" loading="lazy" /></div>}
|
|
130
184
|
<h3><a href={routeLead.href}>{routeLead.name}</a></h3>
|
|
131
185
|
{routeLead.text && <p class="hp-dek">{routeLead.text}</p>}
|
|
@@ -133,7 +187,7 @@ const [toc, tips, faqHtml, afterFaq] = await Promise.all(['toc', 'tips', 'faq',
|
|
|
133
187
|
</article>}
|
|
134
188
|
<ul role="list" class="hp-feed__list">
|
|
135
189
|
{routes.items.map((r) => (
|
|
136
|
-
<li>
|
|
190
|
+
<li id={rowId('route', r)}>
|
|
137
191
|
<div>
|
|
138
192
|
<h3><a href={r.href}>{r.name}</a></h3>
|
|
139
193
|
{r.text && <p>{r.text}</p>}
|
|
@@ -145,7 +199,7 @@ const [toc, tips, faqHtml, afterFaq] = await Promise.all(['toc', 'tips', 'faq',
|
|
|
145
199
|
</ul>
|
|
146
200
|
</div>
|
|
147
201
|
</Container>
|
|
148
|
-
</section
|
|
202
|
+
</section>{!unified && <slot name="after-routes" />}
|
|
149
203
|
{plan && (
|
|
150
204
|
<section class="hp-band" id="when" aria-labelledby="plan-h" data-track-zone="plan-your-visit">
|
|
151
205
|
<Container>
|
|
@@ -178,9 +232,9 @@ const [toc, tips, faqHtml, afterFaq] = await Promise.all(['toc', 'tips', 'faq',
|
|
|
178
232
|
</div>
|
|
179
233
|
</Container>
|
|
180
234
|
</section>
|
|
181
|
-
)}<slot name="after-plan" />
|
|
182
|
-
{tips && <section class="hp-band" id="insider-tips" data-track-zone="insider-tips"><Container><Fragment set:html={tips} /></Container></section>}{faqHtml ? <section class="hp-band hp-band--muted" id="faq" data-track-zone="faq"><Container><Fragment set:html={faqHtml} /></Container></section> : faq && (
|
|
183
|
-
<section class="hp-band hp-band--muted" aria-labelledby="qa-h" data-track-zone="faq">
|
|
235
|
+
)}{!unified && <slot name="after-plan" />}
|
|
236
|
+
{tipsModel && tipsModel.items.length > 0 ? <section class="hp-band" id="insider-tips" data-track-zone="insider-tips"><Container><div class="hp-embed"><InsiderTips items={tipsModel.items} kinds={tipsModel.kinds} title={tipsModel.title} eyebrow={tipsModel.eyebrow} filedByLabel={tipsModel.filedByLabel} author={tipsModel.author} lede={tipsModel.lede} proseClass="" /></div></Container></section> : tips && <section class="hp-band" id="insider-tips" data-track-zone="insider-tips"><Container><Fragment set:html={tips} /></Container></section>}{faqHtml ? <section class="hp-band hp-band--muted" id="faq" data-track-zone="faq"><Container><Fragment set:html={faqHtml} /></Container></section> : faq && (
|
|
237
|
+
<section class="hp-band hp-band--muted" id="faq" aria-labelledby="qa-h" data-track-zone="faq">
|
|
184
238
|
<Container>
|
|
185
239
|
<div class="hp-head">
|
|
186
240
|
<h2 id="qa-h">{faq.heading}</h2>
|
|
@@ -195,15 +249,17 @@ const [toc, tips, faqHtml, afterFaq] = await Promise.all(['toc', 'tips', 'faq',
|
|
|
195
249
|
</dl>
|
|
196
250
|
</Container>
|
|
197
251
|
</section>
|
|
198
|
-
)}{afterFaq && <section class="hp-band" data-track-zone="sources"><Container><Fragment set:html={afterFaq} /></Container></section>}
|
|
252
|
+
)}{(sources && sources.items.length > 0) || alsoExplore ? <section class="hp-band" id="sources" data-track-zone="sources"><Container><div class="hp-embed">{sources && sources.items.length > 0 && <AuthoritativeSources sources={sources.items} title={sources.title} domainClass={sources.domainClass} domainLabels={sources.domainLabels} disambiguate={sources.disambiguate} lang={sources.lang} countLabel={sources.countLabel} showLabel={sources.showLabel} hideLabel={sources.hideLabel} newTabLabel={sources.newTabLabel} />}{alsoExplore && <AlsoExplore items={alsoExplore.items} eyebrow={alsoExplore.eyebrow} locale={alsoExplore.locale} />}</div></Container></section> : afterFaq && <section class="hp-band" data-track-zone="sources"><Container><Fragment set:html={afterFaq} /></Container></section>}
|
|
199
253
|
</main>
|
|
200
254
|
</div>
|
|
201
255
|
|
|
202
256
|
<style>
|
|
203
257
|
.hp.itn .itn-lead { padding-top: clamp(2rem, 5vw, 3.5rem); }
|
|
204
258
|
.hp .itn-also { margin-top: 0.75rem; font-size: 0.9375rem; color: var(--muted-foreground); }
|
|
259
|
+
.hp .itn-intro { margin-top: 1rem; display: grid; gap: 0.75rem; max-width: 40rem; }
|
|
205
260
|
.hp .itn-byline { margin-top: 1.25rem; }
|
|
206
261
|
.hp .itn-toc { padding-block: 1.5rem; }
|
|
262
|
+
.hp .itn-checked { margin-top: 0.25rem; }
|
|
207
263
|
.hp .hp-plan__when :global(.hp-key) { margin-bottom: 1rem; }
|
|
208
264
|
.hp :global(.itn-tours) > div { padding-block: 0.75rem; border-top: var(--hp-rule); display: grid; gap: 0.125rem; }
|
|
209
265
|
.hp :global(.itn-tours a) { font-weight: 600; }
|
|
@@ -217,6 +273,24 @@ const [toc, tips, faqHtml, afterFaq] = await Promise.all(['toc', 'tips', 'faq',
|
|
|
217
273
|
.hp .itn-table td.hp-entry::before { content: none; }
|
|
218
274
|
.hp .itn-table td.hp-entry { white-space: nowrap; font-variant-numeric: tabular-nums; }
|
|
219
275
|
|
|
276
|
+
.hp .itn-answer { max-width: 46rem; margin-bottom: 1.5rem; font-size: 1.0625rem; }
|
|
277
|
+
.hp .itn-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
|
|
278
|
+
.hp .itn-compare { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.9375rem; background: var(--card); border-radius: var(--radius); overflow: hidden; }
|
|
279
|
+
.hp .itn-compare caption { text-align: left; caption-side: top; padding-bottom: 1rem; color: var(--muted-foreground); }
|
|
280
|
+
.hp .itn-compare th, .hp .itn-compare td { text-align: left; padding: 0.875rem 1rem; border-bottom: var(--hp-rule); vertical-align: top; }
|
|
281
|
+
.hp .itn-compare thead th { font-family: var(--font-body); font-weight: 600; font-size: 0.8125rem; color: var(--muted-foreground); border-bottom: 1px solid var(--foreground); }
|
|
282
|
+
.hp .itn-compare tbody tr:last-child > * { border-bottom: 0; }
|
|
283
|
+
.hp .itn-compare th[scope="row"] { font-weight: 400; }
|
|
284
|
+
.hp .itn-compare th[scope="row"] a { font-family: var(--font-display); font-size: 1.125rem; }
|
|
285
|
+
.hp .itn-compare .itn-check { text-align: center; }
|
|
286
|
+
.hp .itn-compare td.itn-check[data-included="true"] { color: var(--primary-strong); font-weight: 600; }
|
|
287
|
+
.hp .itn-compare td.itn-check[data-included="false"] { color: var(--muted-foreground); }
|
|
288
|
+
.hp .itn-compare tr[data-pick="true"] > * { background: color-mix(in oklch, var(--primary) 6%, var(--card)); }
|
|
289
|
+
.hp .itn-pick { display: block; margin-top: 0.25rem; font-size: 0.8125rem; font-weight: 600; color: var(--primary-strong); }
|
|
290
|
+
|
|
291
|
+
.hp .itn-styles { display: grid; gap: 1.5rem; }
|
|
292
|
+
.hp .itn-styles > li { display: grid; gap: 0.375rem; padding-top: 1rem; border-top: var(--hp-rule); }
|
|
293
|
+
|
|
220
294
|
.hp .itn-split { display: grid; gap: 2rem; }
|
|
221
295
|
.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; }
|
|
222
296
|
.hp .hp-trips .hp-meta { display: block; margin-top: 0.375rem; }
|
|
@@ -227,16 +301,29 @@ const [toc, tips, faqHtml, afterFaq] = await Promise.all(['toc', 'tips', 'faq',
|
|
|
227
301
|
.hp .itn-table caption { display: block; padding: 0 0 1rem; background: var(--muted); }
|
|
228
302
|
.hp .itn-table .hp-cal__name { grid-row: 1; }
|
|
229
303
|
.hp .itn-table td.hp-when { grid-row: 2; }
|
|
304
|
+
.hp .itn-compare, .hp .itn-compare tbody, .hp .itn-compare tr, .hp .itn-compare th, .hp .itn-compare td { display: block; width: auto; }
|
|
305
|
+
.hp .itn-compare caption { display: block; padding: 0 0 1rem; background: var(--muted); }
|
|
306
|
+
.hp .itn-compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
|
|
307
|
+
.hp .itn-compare tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.375rem 1rem; padding: 1rem; border-bottom: var(--hp-rule); }
|
|
308
|
+
.hp .itn-compare tbody tr:last-child { border-bottom: 0; }
|
|
309
|
+
.hp .itn-compare th, .hp .itn-compare td { padding: 0; border: 0; }
|
|
310
|
+
.hp .itn-compare th[scope="row"] { grid-column: 1 / -1; }
|
|
311
|
+
.hp .itn-compare td { font-size: 0.875rem; }
|
|
312
|
+
.hp .itn-compare td::before { content: attr(data-label); display: block; font-size: 0.75rem; font-weight: 600; color: var(--muted-foreground); }
|
|
313
|
+
.hp .itn-compare .itn-check { text-align: left; }
|
|
230
314
|
}
|
|
231
315
|
@media (min-width: 40rem) {
|
|
232
316
|
.hp .hp-trips > li > .hp-img { display: block; }
|
|
233
317
|
.hp .itn-table td.hp-entry, .hp .itn-table thead th:last-child { text-align: right; }
|
|
318
|
+
.hp .itn-styles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
234
319
|
}
|
|
235
320
|
@media (min-width: 52rem) {
|
|
236
321
|
.hp .itn-stay > li { grid-template-columns: 8rem minmax(0, 1fr) 14rem; gap: 0 1.5rem; }
|
|
237
322
|
.hp .itn-stay .hp-rank__thumb { grid-row: 1; width: 8rem; height: 6rem; }
|
|
238
323
|
.hp .itn-stay .hp-rank__fact { grid-column: 3; grid-row: 1; text-align: right; }
|
|
239
324
|
.hp .itn-split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
|
|
325
|
+
.hp .itn-split--solo { grid-template-columns: minmax(0, 1fr); }
|
|
240
326
|
.hp .itn-map { position: sticky; top: 6rem; }
|
|
327
|
+
.hp .itn-styles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
|
|
241
328
|
}
|
|
242
329
|
</style>
|
|
@@ -102,19 +102,24 @@ const thingMarks = things.marks ?? months.marks;
|
|
|
102
102
|
<tr><th scope="col">{events.columns.when}</th><th scope="col">{events.columns.name}</th>{showPlace && <th scope="col">{events.columns.place}</th>}{showEntry && <th scope="col">{events.columns.entry}</th>}</tr>
|
|
103
103
|
</thead>
|
|
104
104
|
<tbody>
|
|
105
|
-
{events.rows.map((r) =>
|
|
105
|
+
{events.rows.map((r) => {
|
|
106
|
+
const label = <>{r.href ? <a href={r.href}>{r.name}</a> : <span class="mg-evname">{r.name}</span>}{r.note && <span class="mg-note">{r.note}</span>}</>;
|
|
107
|
+
return (
|
|
106
108
|
<tr>
|
|
107
109
|
<td class="hp-when">{r.when}</td>
|
|
108
110
|
<th scope="row">
|
|
109
111
|
<div class="hp-cal__ev">
|
|
110
112
|
<span class="hp-cal__thumb">{r.image && <ResponsiveImage src={r.image} alt="" sizes="(min-width: 40rem) 96px, 152px" loading="lazy" />}</span>
|
|
111
|
-
|
|
113
|
+
{r.highlights?.length || r.tips
|
|
114
|
+
? <div class="hp-cal__name">{label}{r.highlights && r.highlights.length > 0 && <ul role="list" class="mg-ticks mg-ev-hl">{r.highlights.map((h) => <li>{h}</li>)}</ul>}{r.tips && <p class="mg-ev-tip">{events.tipLabel && <strong>{events.tipLabel} </strong>}{r.tips}</p>}</div>
|
|
115
|
+
: <span class="hp-cal__name">{label}</span>}
|
|
112
116
|
</div>
|
|
113
117
|
</th>
|
|
114
118
|
{showPlace && <td class="hp-where">{r.place}</td>}
|
|
115
119
|
{showEntry && <td class="hp-entry">{r.entry}</td>}
|
|
116
120
|
</tr>
|
|
117
|
-
|
|
121
|
+
);
|
|
122
|
+
})}
|
|
118
123
|
</tbody>
|
|
119
124
|
</table>
|
|
120
125
|
{events.more && <a class="hp-more" href={events.more.href}>{events.more.label}</a>}
|
|
@@ -326,6 +331,8 @@ const thingMarks = things.marks ?? months.marks;
|
|
|
326
331
|
.hp .mg-cal .hp-cal__thumb:empty { visibility: hidden; }
|
|
327
332
|
.hp .mg-evname { font-family: var(--font-display); font-size: 1.125rem; }
|
|
328
333
|
.hp .mg-note { display: block; margin-top: 0.25rem; font-size: 0.875rem; color: var(--muted-foreground); }
|
|
334
|
+
.hp .mg-ev-hl { margin: 0.5rem 0 0; font-size: 0.875rem; font-weight: 400; }
|
|
335
|
+
.hp .mg-ev-tip { margin: 0.5rem 0 0; font-size: 0.875rem; font-weight: 400; max-width: 40rem; }
|
|
329
336
|
|
|
330
337
|
.hp .mg-things .hp-rank__why { max-width: 44rem; }
|
|
331
338
|
|
|
@@ -342,6 +349,7 @@ const thingMarks = things.marks ?? months.marks;
|
|
|
342
349
|
.hp .mg-ticks > li + li { margin-top: 0.5rem; }
|
|
343
350
|
.hp .mg-ticks > li::before { content: ""; position: absolute; left: 0.125rem; top: 0.6em; width: 0.4rem; height: 0.4rem; transform: rotate(45deg); background: var(--primary-strong); }
|
|
344
351
|
.hp .hp-band--inverse .mg-ticks > li::before { background: var(--accent); }
|
|
352
|
+
.hp .mg-ev-hl > li + li { margin-top: 0.25rem; }
|
|
345
353
|
.hp .mg-food-tips { margin-top: 2rem; font-size: 0.9375rem; }
|
|
346
354
|
.hp .hp-dishes .mg-dish { font-family: var(--font-display); font-size: 1.1875rem; }
|
|
347
355
|
.hp .mg-food--solo { grid-template-columns: minmax(0, 1fr); }
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
export { default as TourismItinerariesHub } from './TourismItinerariesHub.astro';
|
|
2
|
-
export
|
|
2
|
+
export { compareRows, itinerariesJsonLd, itinerariesToc } from './tourismItinerariesModel';
|
|
3
|
+
export type {
|
|
4
|
+
TourismItinerariesModel, HubItinerary, HubCompare, HubChecked, HubHead, HubStyle, HubTocEntry, HubSchemaEntry,
|
|
5
|
+
} from './tourismItinerariesModel';
|
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
import type { ImageMetadata } from 'astro';
|
|
2
2
|
import type { HomeHead, HomeLink, HomeMonth } from './tourismHomeModel';
|
|
3
3
|
import type { MarkLabels } from '../sections/marks';
|
|
4
|
+
import type { InsiderTip, InsiderTipAuthor, InsiderTipKinds } from '@sarimarcus/content-sites-ui/editorial';
|
|
5
|
+
import type { DomainClassifier, SourceInput } from '@sarimarcus/content-sites-ui/seo';
|
|
6
|
+
|
|
7
|
+
/** One stay's row in the compare table. `covers` lists the `compare.highlights` labels the stay includes. */
|
|
8
|
+
export interface HubCompare {
|
|
9
|
+
pace: string;
|
|
10
|
+
bestFor: string;
|
|
11
|
+
covers: string[];
|
|
12
|
+
pick?: boolean;
|
|
13
|
+
}
|
|
4
14
|
|
|
5
15
|
export interface HubItinerary {
|
|
16
|
+
/** Gives the item's row its anchor, `<section>-<slug>` (stay-, arrival-, trip-, route-). */
|
|
17
|
+
slug?: string;
|
|
6
18
|
name: string;
|
|
19
|
+
/** A site path or an absolute external URL; either renders as a normal followed link. */
|
|
7
20
|
href: string;
|
|
8
21
|
image?: ImageMetadata;
|
|
9
22
|
imageAlt: string;
|
|
@@ -12,16 +25,33 @@ export interface HubItinerary {
|
|
|
12
25
|
budget?: string;
|
|
13
26
|
journey?: { mode: string; duration: string; fromPrice?: string; perDay?: string };
|
|
14
27
|
journeyMeta?: string;
|
|
28
|
+
/** Stays only: the stay's compare row. A stay without one is left out of the table. */
|
|
29
|
+
compare?: HubCompare;
|
|
15
30
|
}
|
|
16
31
|
|
|
17
|
-
|
|
32
|
+
export interface HubChecked { label: string; datetime: string; display: string }
|
|
33
|
+
|
|
34
|
+
/** Every section head can carry a `checked` date and a shorter `tocLabel` for the table of contents. */
|
|
35
|
+
export type HubHead = HomeHead & { tocLabel?: string; checked?: HubChecked };
|
|
36
|
+
|
|
37
|
+
export interface HubStyle { slug: string; name: string; href: string; text: string }
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Optional sections render nothing when omitted. Named slots: `map`, `tour-disclosure`, the `plan.tours` slots, and,
|
|
41
|
+
* while `toc` is unset only, the deprecated `toc`, `after-lead`, `after-arrivals`, `after-trips`, `after-routes`,
|
|
42
|
+
* `after-plan`, `tips`, `faq` (replaces the model FAQ) and `after-faq`.
|
|
43
|
+
*/
|
|
18
44
|
export interface TourismItinerariesModel {
|
|
19
45
|
lead: {
|
|
20
46
|
heading: string;
|
|
21
47
|
standfirst: string;
|
|
22
|
-
/** HTML. */
|
|
48
|
+
/** HTML, one line. */
|
|
23
49
|
also?: string;
|
|
24
|
-
|
|
50
|
+
/** HTML, one or more paragraphs under the standfirst. */
|
|
51
|
+
intro?: string;
|
|
52
|
+
/** @deprecated Removed in 0.75.0. Ignored once `toc` is set; the table of contents replaces the jump links. */
|
|
53
|
+
links?: HomeLink[];
|
|
54
|
+
/** The jump links' label, and the table of contents' mobile summary. */
|
|
25
55
|
jumpLabel: string;
|
|
26
56
|
photo: { image: ImageMetadata; alt: string; caption?: string };
|
|
27
57
|
author: HomeLink;
|
|
@@ -31,8 +61,21 @@ export interface TourismItinerariesModel {
|
|
|
31
61
|
checkedLabel?: string;
|
|
32
62
|
checked?: { datetime: string; label: string };
|
|
33
63
|
};
|
|
34
|
-
|
|
35
|
-
|
|
64
|
+
/** Set: the ui TableOfContents follows the lead, its entries the sections that render, in page order. */
|
|
65
|
+
toc?: { title: string; ariaLabel?: string; stickyLabel?: (name: string) => string; locale?: string };
|
|
66
|
+
stays: HubHead & { items: HubItinerary[] };
|
|
67
|
+
compare?: HubHead & {
|
|
68
|
+
/** HTML: the one-line answer above the table (plain text plus a link). */
|
|
69
|
+
answer?: string;
|
|
70
|
+
caption: string;
|
|
71
|
+
columns: { itinerary: string; days: string; pace: string; bestFor: string };
|
|
72
|
+
highlights: string[];
|
|
73
|
+
includedLabel: string;
|
|
74
|
+
notIncludedLabel: string;
|
|
75
|
+
pickLabel: string;
|
|
76
|
+
};
|
|
77
|
+
styles?: HubHead & { items: HubStyle[] };
|
|
78
|
+
arrivals?: HubHead & {
|
|
36
79
|
caption: string;
|
|
37
80
|
columns: { route: string; journey: string; mode: string; fare: string };
|
|
38
81
|
perDaySuffix: string;
|
|
@@ -40,10 +83,11 @@ export interface TourismItinerariesModel {
|
|
|
40
83
|
fromLabel: string;
|
|
41
84
|
items: HubItinerary[];
|
|
42
85
|
};
|
|
43
|
-
trips?:
|
|
44
|
-
routes:
|
|
86
|
+
trips?: HubHead & { mapLabel: string; items: HubItinerary[] };
|
|
87
|
+
routes: HubHead & { id: string; trackZone: string; lead?: HubItinerary; items: HubItinerary[] };
|
|
45
88
|
plan?: {
|
|
46
89
|
heading: string;
|
|
90
|
+
tocLabel?: string;
|
|
47
91
|
monthsHeading: string;
|
|
48
92
|
months: HomeMonth[];
|
|
49
93
|
marks: MarkLabels;
|
|
@@ -53,6 +97,76 @@ export interface TourismItinerariesModel {
|
|
|
53
97
|
/** Each named slot contains the site's affiliate link, followed by its meta. */
|
|
54
98
|
tours?: { heading: string; items: { slot: string; meta: string }[]; more: HomeLink };
|
|
55
99
|
};
|
|
56
|
-
|
|
57
|
-
|
|
100
|
+
tips?: {
|
|
101
|
+
title: string;
|
|
102
|
+
tocLabel?: string;
|
|
103
|
+
eyebrow: string;
|
|
104
|
+
filedByLabel: string;
|
|
105
|
+
author?: InsiderTipAuthor;
|
|
106
|
+
lede?: string;
|
|
107
|
+
kinds: InsiderTipKinds;
|
|
108
|
+
items: InsiderTip[];
|
|
109
|
+
};
|
|
110
|
+
/** Omit when the page fills the deprecated `faq` slot. */
|
|
111
|
+
faq?: { heading: string; tocLabel?: string; items: { question: string; /** HTML. */ answer: string }[] };
|
|
112
|
+
/** `domainClass` is the site's outbound-domains store, so the Rule 38 rel handling holds. */
|
|
113
|
+
sources?: {
|
|
114
|
+
title: string;
|
|
115
|
+
tocLabel?: string;
|
|
116
|
+
items: SourceInput[];
|
|
117
|
+
domainClass: DomainClassifier;
|
|
118
|
+
domainLabels?: Record<string, string>;
|
|
119
|
+
disambiguate?: boolean;
|
|
120
|
+
/** The ui defaults are English; set these on a non-English site. */
|
|
121
|
+
lang?: string;
|
|
122
|
+
countLabel?: string;
|
|
123
|
+
showLabel?: string;
|
|
124
|
+
hideLabel?: string;
|
|
125
|
+
newTabLabel?: string;
|
|
126
|
+
};
|
|
127
|
+
alsoExplore?: { eyebrow?: string; locale?: string; items: HomeLink[] };
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface HubTocEntry { label: string; href: string }
|
|
131
|
+
|
|
132
|
+
/** The table of contents: one entry per section that renders, in page order. */
|
|
133
|
+
export function itinerariesToc(model: TourismItinerariesModel): HubTocEntry[] {
|
|
134
|
+
const { stays, compare, styles, arrivals, trips, routes, plan, tips, faq, sources } = model;
|
|
135
|
+
const entry = (id: string, s: { heading?: string; title?: string; tocLabel?: string } | undefined, show = true) =>
|
|
136
|
+
s && show ? [{ label: s.tocLabel ?? s.heading ?? s.title ?? '', href: `#${id}` }] : [];
|
|
137
|
+
return [
|
|
138
|
+
...entry('stays', stays, stays.items.length > 0),
|
|
139
|
+
...entry('compare', compare, compareRows(model).length > 0),
|
|
140
|
+
...entry('styles', styles, (styles?.items.length ?? 0) > 0),
|
|
141
|
+
...entry('getting-here', arrivals),
|
|
142
|
+
...entry('day-trips', trips),
|
|
143
|
+
...entry(routes.id, routes),
|
|
144
|
+
...entry('when', plan),
|
|
145
|
+
...entry('insider-tips', tips, (tips?.items.length ?? 0) > 0),
|
|
146
|
+
...entry('faq', faq),
|
|
147
|
+
...entry('sources', sources, (sources?.items.length ?? 0) > 0),
|
|
148
|
+
].filter((e) => e.label);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export const compareRows = (model: TourismItinerariesModel) =>
|
|
152
|
+
model.compare ? model.stays.items.filter((i): i is HubItinerary & { compare: HubCompare } => !!i.compare) : [];
|
|
153
|
+
|
|
154
|
+
export const rowId = (prefix: string, item: { slug?: string }) => (item.slug ? `${prefix}-${item.slug}` : undefined);
|
|
155
|
+
|
|
156
|
+
export interface HubSchemaEntry { type: string; data: Record<string, unknown> }
|
|
157
|
+
|
|
158
|
+
/** The page's JSON-LD entries for the site `StructuredData`: the hub list (register `itinerariesHubBuilder()` as `itinerariesHub`) and the FAQ. */
|
|
159
|
+
export function itinerariesJsonLd(model: TourismItinerariesModel): HubSchemaEntry[] {
|
|
160
|
+
const entries: HubSchemaEntry[] = [{
|
|
161
|
+
type: 'itinerariesHub',
|
|
162
|
+
data: {
|
|
163
|
+
name: model.lead.heading,
|
|
164
|
+
description: model.lead.standfirst,
|
|
165
|
+
stays: model.stays.items.map((s) => ({ name: s.name, href: s.href, description: s.text, covers: s.compare?.covers ?? [] })),
|
|
166
|
+
},
|
|
167
|
+
}];
|
|
168
|
+
if (model.faq?.items.length) {
|
|
169
|
+
entries.push({ type: 'faqPage', data: { questions: model.faq.items.map((q) => ({ question: q.question, answer: q.answer })) } });
|
|
170
|
+
}
|
|
171
|
+
return entries;
|
|
58
172
|
}
|
|
@@ -33,7 +33,7 @@ export interface MonthClimateTable {
|
|
|
33
33
|
|
|
34
34
|
export interface MonthPeriod { period: string; range: string; facts: string; text: string }
|
|
35
35
|
|
|
36
|
-
export interface MonthEventRow { when: string; name: string; href?: string; image?: ImageMetadata; place?: string; entry?: string; note?: string }
|
|
36
|
+
export interface MonthEventRow { when: string; name: string; href?: string; image?: ImageMetadata; place?: string; entry?: string; note?: string; highlights?: string[]; tips?: string }
|
|
37
37
|
|
|
38
38
|
export interface MonthThing { title: string; href?: string; text: string; image?: ImageMetadata; mark?: MarkKind }
|
|
39
39
|
|
|
@@ -59,7 +59,8 @@ export interface TourismMonthGuideModel {
|
|
|
59
59
|
/** `prev`/`next` render at the foot of the page; `kicker` is the small line above each ("Previous month"). */
|
|
60
60
|
months: MonthStrip & { prev: HomeLink & { kicker: string }; next: HomeLink & { kicker: string }; adjacentLabel: string };
|
|
61
61
|
weather: HomeHead & { table: MonthClimateTable; periods?: MonthPeriod[]; /** HTML. */ tip?: string };
|
|
62
|
-
|
|
62
|
+
/** `tipLabel` prefixes a row's `tips`. */
|
|
63
|
+
events?: HomeHead & { caption: string; columns: { when: string; name: string; place: string; entry: string }; rows: MonthEventRow[]; tipLabel?: string; more?: HomeLink };
|
|
63
64
|
things: HomeHead & { items: MonthThing[]; marks?: MarkLabels };
|
|
64
65
|
features?: MonthFeature[];
|
|
65
66
|
food?: HomeHead & {
|