@sarimarcus/content-sites-tourism 0.33.0 → 0.34.1
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,14 @@
|
|
|
2
2
|
|
|
3
3
|
All packages in the platform release in lockstep; entries are per release version.
|
|
4
4
|
|
|
5
|
+
## 0.34.1 (2026-10-12)
|
|
6
|
+
|
|
7
|
+
- `DetailBody` takes `as`, `anchored`, `pagefind` and `transformHtml` props and an `interludes` slot, so Córdoba's and Granada's entity bodies adopt it (SLA-3043). Additive. The root's class order is now `<prose> max-w-none <class> scroll-mt-28`; no site renders 0.33.0's `DetailBody`.
|
|
8
|
+
|
|
9
|
+
## 0.34.0 (2026-10-12)
|
|
10
|
+
|
|
11
|
+
- `MonumentHero` and `QuartierHero` join `@sarimarcus/content-sites-tourism/sections` (SLA-3041), built on ui `ContentHero`. The site adapter resolves the optimized image, the placeholder, the copy and the directions link, and passes them as props.
|
|
12
|
+
|
|
5
13
|
## 0.33.0 (2026-10-12)
|
|
6
14
|
|
|
7
15
|
- `./templates` adds `DetailBody` (lede plus one anchored `<section>` per H2, with `data-guide-section` on the article when the body has no H2) and `bodyTocItems`, so an entity page's ToC and body come from one array. Additive; adopting it on Granada's detail routes is an intended layout change (SLA-3043).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sarimarcus/content-sites-tourism",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.1",
|
|
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",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"astro": "^7.0.6",
|
|
37
37
|
"tailwindcss": "^4.1.18",
|
|
38
|
-
"@sarimarcus/content-sites-core": "0.
|
|
39
|
-
"@sarimarcus/content-sites-ui": "0.
|
|
38
|
+
"@sarimarcus/content-sites-core": "0.34.1",
|
|
39
|
+
"@sarimarcus/content-sites-ui": "0.34.1"
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
/**
|
|
3
|
+
* MonumentHero — ContentHero for a monument: UNESCO badge, tag badges and the hours / fees / directions chips.
|
|
4
|
+
* The site adapter resolves the optimized image and the placeholder; the package never globs site assets.
|
|
5
|
+
*/
|
|
6
|
+
import { Badge } from '@sarimarcus/content-sites-ui/primitives';
|
|
7
|
+
import { ContentHero } from '@sarimarcus/content-sites-ui/layout';
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
image?: ImageMetadata;
|
|
13
|
+
imageFallback?: string;
|
|
14
|
+
imagePlaceholder?: string;
|
|
15
|
+
hours?: string;
|
|
16
|
+
fees?: string;
|
|
17
|
+
/** Link of the directions chip; the chip is omitted without it. */
|
|
18
|
+
directionsHref?: string;
|
|
19
|
+
tags?: string[];
|
|
20
|
+
unescoLabel: string;
|
|
21
|
+
directionsLabel: string;
|
|
22
|
+
class?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const {
|
|
26
|
+
name,
|
|
27
|
+
description,
|
|
28
|
+
image,
|
|
29
|
+
imageFallback,
|
|
30
|
+
imagePlaceholder,
|
|
31
|
+
hours,
|
|
32
|
+
fees,
|
|
33
|
+
directionsHref,
|
|
34
|
+
tags = [],
|
|
35
|
+
unescoLabel,
|
|
36
|
+
directionsLabel,
|
|
37
|
+
class: className,
|
|
38
|
+
} = Astro.props;
|
|
39
|
+
|
|
40
|
+
const isUNESCO = tags.includes('unesco');
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
<ContentHero
|
|
44
|
+
title={name}
|
|
45
|
+
description={description}
|
|
46
|
+
image={image}
|
|
47
|
+
imageFallback={imageFallback}
|
|
48
|
+
imagePlaceholder={imagePlaceholder}
|
|
49
|
+
imageAlt={name}
|
|
50
|
+
theme="dark"
|
|
51
|
+
class={className}
|
|
52
|
+
>
|
|
53
|
+
<Fragment slot="badges">
|
|
54
|
+
{isUNESCO && (
|
|
55
|
+
<Badge tone="custom" toneClass="bg-accent text-shadow" size="lg" lines={0} class="!py-1">
|
|
56
|
+
<svg class="w-4 h-4" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
|
|
57
|
+
<path d="M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z" />
|
|
58
|
+
</svg>
|
|
59
|
+
{unescoLabel}
|
|
60
|
+
</Badge>
|
|
61
|
+
)}
|
|
62
|
+
{tags.filter((t) => t !== 'unesco').slice(0, 3).map((tag) => (
|
|
63
|
+
<Badge tone="onImage" size="lg" lines={0} class="!py-1 ![font-weight:inherit]">
|
|
64
|
+
{tag}
|
|
65
|
+
</Badge>
|
|
66
|
+
))}
|
|
67
|
+
</Fragment>
|
|
68
|
+
<Fragment slot="info">
|
|
69
|
+
{hours && (
|
|
70
|
+
<div class="inline-flex items-center gap-2 px-4 py-2 bg-chalk/95 backdrop-blur-sm rounded-lg text-shadow">
|
|
71
|
+
<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
|
+
<circle cx="12" cy="12" r="10" /><polyline points="12 6 12 12 16 14" />
|
|
73
|
+
</svg>
|
|
74
|
+
<span class="text-sm">{hours.split(',')[0]}</span>
|
|
75
|
+
</div>
|
|
76
|
+
)}
|
|
77
|
+
{fees && (
|
|
78
|
+
<div class="inline-flex items-center gap-2 px-4 py-2 bg-chalk/95 backdrop-blur-sm rounded-lg text-shadow">
|
|
79
|
+
<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
|
+
<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
|
+
</svg>
|
|
82
|
+
<span class="text-sm">{fees}</span>
|
|
83
|
+
</div>
|
|
84
|
+
)}
|
|
85
|
+
{directionsHref && (
|
|
86
|
+
<a
|
|
87
|
+
href={directionsHref}
|
|
88
|
+
target="_blank"
|
|
89
|
+
class="inline-flex items-center gap-2 px-4 py-2 bg-primary/90 hover:bg-primary backdrop-blur-sm rounded-lg text-chalk transition-colors"
|
|
90
|
+
>
|
|
91
|
+
<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">
|
|
92
|
+
<polygon points="3 11 22 2 13 21 11 13 3 11" />
|
|
93
|
+
</svg>
|
|
94
|
+
<span class="text-sm">{directionsLabel}</span>
|
|
95
|
+
</a>
|
|
96
|
+
)}
|
|
97
|
+
</Fragment>
|
|
98
|
+
<Fragment slot="actions"><slot name="actions" /></Fragment>
|
|
99
|
+
</ContentHero>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
/**
|
|
3
|
+
* QuartierHero — ContentHero for a neighbourhood: badge and atmosphere tagline. The site adapter resolves the
|
|
4
|
+
* optimized image and the placeholder; the package never globs site assets.
|
|
5
|
+
*/
|
|
6
|
+
import { Badge } from '@sarimarcus/content-sites-ui/primitives';
|
|
7
|
+
import { ContentHero } from '@sarimarcus/content-sites-ui/layout';
|
|
8
|
+
|
|
9
|
+
interface Props {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
image?: ImageMetadata;
|
|
13
|
+
imageFallback?: string;
|
|
14
|
+
imagePlaceholder?: string;
|
|
15
|
+
atmosphere?: string;
|
|
16
|
+
badgeLabel: string;
|
|
17
|
+
imageAlt: string;
|
|
18
|
+
class?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const {
|
|
22
|
+
name,
|
|
23
|
+
description,
|
|
24
|
+
image,
|
|
25
|
+
imageFallback,
|
|
26
|
+
imagePlaceholder,
|
|
27
|
+
atmosphere,
|
|
28
|
+
badgeLabel,
|
|
29
|
+
imageAlt,
|
|
30
|
+
class: className,
|
|
31
|
+
} = Astro.props;
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
<ContentHero
|
|
35
|
+
title={name}
|
|
36
|
+
description={description}
|
|
37
|
+
image={image}
|
|
38
|
+
imageFallback={imageFallback}
|
|
39
|
+
imagePlaceholder={imagePlaceholder}
|
|
40
|
+
imageAlt={imageAlt}
|
|
41
|
+
theme="dark"
|
|
42
|
+
class={className}
|
|
43
|
+
>
|
|
44
|
+
<Fragment slot="badges">
|
|
45
|
+
<Badge tone="custom" toneClass="bg-primary/90 text-chalk backdrop-blur-sm" size="lg" lines={0} class="!py-1 ![font-weight:inherit] !gap-2">
|
|
46
|
+
<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">
|
|
47
|
+
<rect width="16" height="20" x="4" y="2" rx="2" ry="2" /><path d="M9 22v-4h6v4" /><path d="M8 6h.01" /><path d="M16 6h.01" /><path d="M12 6h.01" /><path d="M12 10h.01" /><path d="M12 14h.01" /><path d="M16 10h.01" /><path d="M16 14h.01" /><path d="M8 10h.01" /><path d="M8 14h.01" />
|
|
48
|
+
</svg>
|
|
49
|
+
{badgeLabel}
|
|
50
|
+
</Badge>
|
|
51
|
+
</Fragment>
|
|
52
|
+
{atmosphere && (
|
|
53
|
+
<p slot="subtitle" class="text-lg sm:text-xl text-accent italic">{atmosphere}</p>
|
|
54
|
+
)}
|
|
55
|
+
</ContentHero>
|
package/src/sections/index.ts
CHANGED
|
@@ -12,6 +12,8 @@ export { default as HomeTripPlanner } from './HomeTripPlanner.astro';
|
|
|
12
12
|
export { default as MonumentBody } from './MonumentBody.astro';
|
|
13
13
|
export { default as MonumentBodySlot } from './MonumentBodySlot.astro';
|
|
14
14
|
export { default as ArticleCardGrid } from './ArticleCardGrid.astro';
|
|
15
|
+
export { default as MonumentHero } from './MonumentHero.astro';
|
|
16
|
+
export { default as QuartierHero } from './QuartierHero.astro';
|
|
15
17
|
export type { WalkStop } from './WalkStops.astro';
|
|
16
18
|
export type { WhoItsForTag } from './WhoItsFor.astro';
|
|
17
19
|
export type { NeighborhoodCategoryType } from './NeighborhoodCategory.astro';
|
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Entity detail body: the `longDescription` lede plus one anchored `<section>`
|
|
4
4
|
* per H2, so the ToC (`bodyTocItems`) and the markup come from one array. Without
|
|
5
|
-
* a `longDescription` it renders the
|
|
5
|
+
* a `longDescription` it renders the default slot, or `description` as a
|
|
6
6
|
* paragraph in the `#description` anchor.
|
|
7
|
+
*
|
|
8
|
+
* `anchored={false}` drops the `#description` anchor, its scroll offset and the
|
|
9
|
+
* fallback, for pages whose ToC targets come from a wrapper around this body.
|
|
10
|
+
* The `interludes` slot renders between the lede and the first section.
|
|
7
11
|
*/
|
|
8
12
|
import type { DetailBodyContent } from './detailBody.ts';
|
|
9
13
|
|
|
@@ -14,6 +18,11 @@ interface Props {
|
|
|
14
18
|
description?: string;
|
|
15
19
|
proseClass?: string;
|
|
16
20
|
class?: string;
|
|
21
|
+
as?: 'article' | 'div';
|
|
22
|
+
anchored?: boolean;
|
|
23
|
+
pagefind?: boolean;
|
|
24
|
+
/** Maps each rendered HTML fragment (lede and sections), e.g. to tag affiliate links. */
|
|
25
|
+
transformHtml?: (html: string) => string;
|
|
17
26
|
}
|
|
18
27
|
|
|
19
28
|
const {
|
|
@@ -22,27 +31,47 @@ const {
|
|
|
22
31
|
description,
|
|
23
32
|
proseClass = 'prose prose-lg',
|
|
24
33
|
class: className = 'mb-6',
|
|
34
|
+
as: root = 'article',
|
|
35
|
+
anchored = true,
|
|
36
|
+
pagefind = true,
|
|
37
|
+
transformHtml = (html: string) => html,
|
|
25
38
|
} = Astro.props;
|
|
26
39
|
|
|
40
|
+
const hasInterludes = Astro.slots.has('interludes');
|
|
27
41
|
const showBody = hasBody && (!!body.lede || body.sections.length > 0);
|
|
28
|
-
// With no H2 the
|
|
29
|
-
const
|
|
42
|
+
// With no H2 the root is the lone ToC target, so it is the scroll-spy section.
|
|
43
|
+
const idAttr = anchored ? { id: 'description' } : {};
|
|
44
|
+
const pagefindAttr = pagefind ? { 'data-pagefind-body': '' } : {};
|
|
45
|
+
const guideAttr = anchored && body.sections.length === 0 ? { 'data-guide-section': '' } : {};
|
|
46
|
+
const rootClass = [proseClass, 'max-w-none', className, anchored && 'scroll-mt-28'];
|
|
30
47
|
---
|
|
31
48
|
|
|
32
49
|
{showBody ? (
|
|
33
|
-
|
|
34
|
-
|
|
50
|
+
root === 'div' ? (
|
|
51
|
+
<div {...idAttr} class:list={rootClass} {...pagefindAttr} {...guideAttr}>
|
|
52
|
+
{body.lede && <Fragment set:html={transformHtml(body.lede)} />}{hasInterludes && <slot name="interludes" />}
|
|
35
53
|
{body.sections.map((s) => (
|
|
36
54
|
<section id={s.id} data-guide-section class="scroll-mt-28">
|
|
37
55
|
<h2 set:html={s.headingHtml} />
|
|
38
|
-
<Fragment set:html={s.html} />
|
|
56
|
+
<Fragment set:html={transformHtml(s.html)} />
|
|
57
|
+
</section>
|
|
58
|
+
))}
|
|
59
|
+
</div>
|
|
60
|
+
) : (
|
|
61
|
+
<article {...idAttr} class:list={rootClass} {...pagefindAttr} {...guideAttr}>
|
|
62
|
+
{body.lede && <Fragment set:html={transformHtml(body.lede)} />}{hasInterludes && <slot name="interludes" />}
|
|
63
|
+
{body.sections.map((s) => (
|
|
64
|
+
<section id={s.id} data-guide-section class="scroll-mt-28">
|
|
65
|
+
<h2 set:html={s.headingHtml} />
|
|
66
|
+
<Fragment set:html={transformHtml(s.html)} />
|
|
39
67
|
</section>
|
|
40
68
|
))}
|
|
41
69
|
</article>
|
|
42
|
-
)
|
|
43
|
-
|
|
70
|
+
)
|
|
71
|
+
) : anchored ? (
|
|
72
|
+
<div id="description" data-guide-section class:list={[className, 'scroll-mt-28']}>
|
|
44
73
|
<slot>
|
|
45
74
|
<p class="text-lg text-foreground leading-relaxed">{description}</p>
|
|
46
75
|
</slot>
|
|
47
76
|
</div>
|
|
48
|
-
)}
|
|
77
|
+
) : null}
|