@sarimarcus/content-sites-ui 0.32.0 → 0.32.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 +4 -0
- package/package.json +2 -2
- package/src/editorial/EventPage.astro +41 -20
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All packages in the platform release in lockstep; entries are per release version.
|
|
4
4
|
|
|
5
|
+
## 0.32.1 (2026-10-09)
|
|
6
|
+
|
|
7
|
+
- `./editorial` `EventPage` takes `audiences` (one sr-only `audience:` Pagefind filter span per entry inside the hero wrapper), and `article`/`highlights` take `id`, an extra `class` and `section` (a bare `data-<section>-section` attribute). `bodyHtml` and `backLink` are optional. New slots: `back` (replaces the back link), `before-body`, `body` (replaces the `<article>`), `after-highlights` and `website` (replaces the official-website button). Default output is unchanged (render-diff 3/3; Dark Skies 0 of 687 pages). Site adoption: `scripts/platform/migrations/event-page.mjs` (17 Córdoba event pages, block-level whitespace; 12 Granada event pages, also `shrink-0` on heading and practical-row icons) and, for Granada walks, `scripts/platform/migrations/walk-pagefind.mjs` (8 pages indexed as `type:walk`) (SLA-3025).
|
|
8
|
+
|
|
5
9
|
## 0.32.0 (2026-10-09)
|
|
6
10
|
|
|
7
11
|
- Optional label props, so every reader-visible string can come from the site: Pagination `ariaLabel`, `previousLabel`, `nextLabel`, `pageLabel`, `currentPageLabel`; TableOfContents `jumpLabel`, `stickyLabel`; CardCarousel `regionLabel`, `previousLabel`, `nextLabel`; SiteFooter `rightsLabel`, `legalAriaLabel`; NotFoundPage `searchShortcut`; VisitTiming `labels`. Optional `routes` on ArticleCategoryNav and on `toArticleAuthor` (4th argument). English defaults move from the templates into an internal labels module; output is byte-identical (render-diff 48/48) (SLA-2991).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sarimarcus/content-sites-ui",
|
|
3
|
-
"version": "0.32.
|
|
3
|
+
"version": "0.32.1",
|
|
4
4
|
"description": "Universal Astro UI components, layout shell and design tokens shared by the content sites.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -49,6 +49,6 @@
|
|
|
49
49
|
"@lucide/astro": "^1.23.0",
|
|
50
50
|
"astro": "^7.0.6",
|
|
51
51
|
"tailwindcss": "^4.1.18",
|
|
52
|
-
"@sarimarcus/content-sites-core": "0.32.
|
|
52
|
+
"@sarimarcus/content-sites-core": "0.32.1"
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -2,12 +2,19 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* EventPage — the shell and shared body of an event page. The route keeps paths, data, SEO and schema, and renders
|
|
4
4
|
* the site Layout around this template. Slots:
|
|
5
|
-
* breadcrumb
|
|
6
|
-
* hero
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
5
|
+
* breadcrumb — the site Breadcrumb, in the band under the header.
|
|
6
|
+
* hero — the site hero, inside the Pagefind body with `type:<pagefindType>` meta, after one sr-only
|
|
7
|
+
* `audience:<a>` filter span per `audiences` entry.
|
|
8
|
+
* back — replaces the `backLink` anchor.
|
|
9
|
+
* before-body — site blocks between the back link and the description (chips, ToC, metadata).
|
|
10
|
+
* body — replaces the built-in `<article>` (a route that renders its own sections).
|
|
11
|
+
* after-body — site blocks between the description and the shared boxes.
|
|
12
|
+
* after-highlights — site blocks between the highlights and the practical information.
|
|
13
|
+
* website — replaces the `officialWebsite` block.
|
|
14
|
+
* after-details — site blocks after the tags, inside the measure column (affiliate, FAQ, onward links).
|
|
15
|
+
* tail — full-width blocks after the column (related events, related content).
|
|
16
|
+
* Every string arrives as a prop; the route renders markdown and passes it as TrustedHtml. `article` and `highlights`
|
|
17
|
+
* take an `id`, extra classes and a `section` name, which emits `data-<section>-section` (a ToC scroll-spy target).
|
|
11
18
|
*/
|
|
12
19
|
import Container from '../layout/Container.astro';
|
|
13
20
|
import Badge from '../primitives/Badge.astro';
|
|
@@ -16,22 +23,35 @@ import { newTab } from '../primitives/newTab';
|
|
|
16
23
|
import type { TrustedHtml } from '../types';
|
|
17
24
|
import type { EventInfoRow } from './event';
|
|
18
25
|
|
|
26
|
+
interface Section {
|
|
27
|
+
id?: string;
|
|
28
|
+
/** Appended to the block's own classes. */
|
|
29
|
+
class?: string;
|
|
30
|
+
/** Emits `data-<section>-section`. */
|
|
31
|
+
section?: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
19
34
|
interface Props {
|
|
20
|
-
|
|
35
|
+
/** Required unless the `body` slot replaces the article. */
|
|
36
|
+
bodyHtml?: TrustedHtml;
|
|
21
37
|
/** Prose modifiers after `prose`, e.g. the site's prose theme and size. */
|
|
22
38
|
proseClass?: string;
|
|
23
|
-
|
|
24
|
-
|
|
39
|
+
article?: Section;
|
|
40
|
+
/** Required unless the `back` slot replaces it. */
|
|
41
|
+
backLink?: { href: string; label: string };
|
|
42
|
+
highlights?: { heading: string; items: string[] } & Section;
|
|
25
43
|
practicalInfo?: { heading: string; rows: EventInfoRow[] };
|
|
26
44
|
price?: { label: string; value: string };
|
|
27
45
|
officialWebsite?: { href: string; label: string };
|
|
28
46
|
tags?: { heading: string; items: string[] };
|
|
29
47
|
pagefindType?: string;
|
|
48
|
+
audiences?: readonly string[];
|
|
30
49
|
}
|
|
31
50
|
|
|
32
51
|
const {
|
|
33
52
|
bodyHtml,
|
|
34
53
|
proseClass = 'prose-lg',
|
|
54
|
+
article,
|
|
35
55
|
backLink,
|
|
36
56
|
highlights,
|
|
37
57
|
practicalInfo,
|
|
@@ -39,9 +59,12 @@ const {
|
|
|
39
59
|
officialWebsite,
|
|
40
60
|
tags,
|
|
41
61
|
pagefindType = 'event',
|
|
62
|
+
audiences = [],
|
|
42
63
|
} = Astro.props;
|
|
43
64
|
|
|
44
65
|
const toneText = { primary: 'text-primary', secondary: 'text-secondary', accent: 'text-accent' };
|
|
66
|
+
const sectionAttr = (s?: Section) => (s?.section ? { [`data-${s.section}-section`]: '' } : {});
|
|
67
|
+
const withClass = (base: string, s?: Section) => (s?.class ? `${base} ${s.class}` : base);
|
|
45
68
|
---
|
|
46
69
|
|
|
47
70
|
<BreadcrumbBand>
|
|
@@ -49,12 +72,12 @@ const toneText = { primary: 'text-primary', secondary: 'text-secondary', accent:
|
|
|
49
72
|
</BreadcrumbBand>
|
|
50
73
|
|
|
51
74
|
<div data-pagefind-body data-pagefind-meta={`type:${pagefindType}`}>
|
|
52
|
-
<slot name="hero" />
|
|
75
|
+
{audiences.map((a) => <span class="sr-only" data-pagefind-filter={`audience:${a}`}>{a}</span>)}<slot name="hero" />
|
|
53
76
|
</div>
|
|
54
77
|
|
|
55
78
|
<main class="pt-6 pb-12 lg:pt-8 lg:pb-20">
|
|
56
79
|
<Container size="measure">
|
|
57
|
-
<a
|
|
80
|
+
<slot name="back">{backLink && (<a
|
|
58
81
|
href={backLink.href}
|
|
59
82
|
class="inline-flex items-center gap-2 text-sm text-muted-foreground hover:text-primary transition-colors mb-8"
|
|
60
83
|
>
|
|
@@ -62,16 +85,16 @@ const toneText = { primary: 'text-primary', secondary: 'text-secondary', accent:
|
|
|
62
85
|
<path d="m12 19-7-7 7-7" /><path d="M19 12H5" />
|
|
63
86
|
</svg>
|
|
64
87
|
{backLink.label}
|
|
65
|
-
</a>
|
|
88
|
+
</a>)}</slot>
|
|
66
89
|
|
|
67
|
-
<article class={`prose ${proseClass} max-w-none
|
|
90
|
+
<slot name="before-body" /><slot name="body"><article id={article?.id} {...sectionAttr(article)} class={withClass(`prose ${proseClass} max-w-none`, article)} data-pagefind-body>
|
|
68
91
|
<div set:html={bodyHtml} />
|
|
69
|
-
</article>
|
|
92
|
+
</article></slot>
|
|
70
93
|
|
|
71
94
|
<slot name="after-body" />
|
|
72
95
|
|
|
73
96
|
{highlights && highlights.items.length > 0 && (
|
|
74
|
-
<div class=
|
|
97
|
+
<div id={highlights.id} {...sectionAttr(highlights)} class={withClass('mt-12 p-6 bg-primary/5 rounded-xl border border-primary/20', highlights)}>
|
|
75
98
|
<h2
|
|
76
99
|
class="text-xl font-medium mb-6 flex items-center gap-2 font-display"
|
|
77
100
|
>
|
|
@@ -93,7 +116,7 @@ const toneText = { primary: 'text-primary', secondary: 'text-secondary', accent:
|
|
|
93
116
|
</div>
|
|
94
117
|
)}
|
|
95
118
|
|
|
96
|
-
{practicalInfo && (
|
|
119
|
+
<slot name="after-highlights" />{practicalInfo && (
|
|
97
120
|
<div class="mt-12 p-6 bg-muted/50 rounded-xl border border-border">
|
|
98
121
|
<h2
|
|
99
122
|
class="text-xl font-medium mb-6 flex items-center gap-2 font-display"
|
|
@@ -141,7 +164,7 @@ const toneText = { primary: 'text-primary', secondary: 'text-secondary', accent:
|
|
|
141
164
|
</div>
|
|
142
165
|
)}
|
|
143
166
|
|
|
144
|
-
{officialWebsite && (
|
|
167
|
+
<slot name="website">{officialWebsite && (
|
|
145
168
|
<div class="mt-8">
|
|
146
169
|
<a
|
|
147
170
|
href={officialWebsite.href}
|
|
@@ -154,9 +177,7 @@ const toneText = { primary: 'text-primary', secondary: 'text-secondary', accent:
|
|
|
154
177
|
{officialWebsite.label}
|
|
155
178
|
</a>
|
|
156
179
|
</div>
|
|
157
|
-
)}
|
|
158
|
-
|
|
159
|
-
{tags && tags.items.length > 0 && (
|
|
180
|
+
)}</slot>{tags && tags.items.length > 0 && (
|
|
160
181
|
<div class="mt-8">
|
|
161
182
|
<h3 class="text-sm font-medium text-muted-foreground mb-3">
|
|
162
183
|
{tags.heading}
|