@sarimarcus/content-sites-ui 0.43.0 → 0.44.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,14 @@
2
2
 
3
3
  All packages in the platform release in lockstep; entries are per release version.
4
4
 
5
+ ## 0.44.0 (2026-10-22)
6
+
7
+ - `editorial`: `PeopleHub` gains `introHtml` and `eraNotesHtml`, the intro paragraphs and per-era notes as site-rendered `TrustedHtml` (inline emphasis); when set they win over the plain `intro` and `eraNotes`, and plain strings render as before through `textAsHtml()`. The footsteps block now lists each era's dossiers only, oldest era first, deduped by href (SLA-3314).
8
+
9
+ ### Breaking
10
+
11
+ - `footstepLinks(eras, people)` is now `footstepLinks(eras)`, and `PeopleHub` no longer reads `people[].article`: the "walk in their footsteps" block lists era dossiers only, so a site passing `article` still compiles and the field is ignored. Both shipped in 0.42.4 and only `PeopleHub` calls them; the one site passing `article` (turism-cordoba-en) drops it in its adoption commit, so there is no codemod. Expect an HTML change on that site's people hub (SLA-3314).
12
+
5
13
  ## 0.43.0 (2026-10-22)
6
14
 
7
15
  ### Breaking
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sarimarcus/content-sites-ui",
3
- "version": "0.43.0",
3
+ "version": "0.44.0",
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",
@@ -50,6 +50,6 @@
50
50
  "@lucide/astro": "^1.23.0",
51
51
  "astro": "^7.0.6",
52
52
  "tailwindcss": "^4.1.18",
53
- "@sarimarcus/content-sites-core": "0.43.0"
53
+ "@sarimarcus/content-sites-core": "0.44.0"
54
54
  }
55
55
  }
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * PeopleHub — the body of a people hub page: title band, era index, people timeline, then one section per era
4
4
  * (era hook and intro, an optional people-focused line, PersonCards) and a closing "walk in their footsteps" block
5
- * built from the eras' dossiers and each person's article. Prose arrives as props: nothing is written here.
5
+ * listing the dossiers of the eras shown. Prose arrives as props: nothing is written here.
6
6
  * The site keeps Layout, StructuredData and the breadcrumb band, and wraps this in `<main>`.
7
7
  */
8
8
  import type { ImageMetadata } from 'astro';
@@ -13,6 +13,7 @@ import LinkArrow from '../primitives/LinkArrow.astro';
13
13
  import PersonCard from './PersonCard.astro';
14
14
  import PeopleTimeline from './PeopleTimeline.astro';
15
15
  import { LABELS } from '../internal/labels';
16
+ import { textAsHtml, type TrustedHtml } from '../types';
16
17
  import { footstepLinks, layoutPeopleTimeline, type PeopleTimelineEntry } from './people-timeline';
17
18
 
18
19
  interface HubPerson extends PeopleTimelineEntry {
@@ -20,20 +21,22 @@ interface HubPerson extends PeopleTimelineEntry {
20
21
  imageAlt: string;
21
22
  roles?: readonly string[];
22
23
  knownFor?: string;
23
- /** The person's main article, listed in the footsteps block. */
24
- article?: { label: string; href: string };
25
24
  }
26
25
 
27
26
  interface Props {
28
27
  title: string;
29
28
  /** Under the title, 1-2 short lines. */
30
29
  lede?: string;
31
- /** Hub intro paragraphs, shown under the lede band. */
30
+ /** Hub intro paragraphs, shown under the lede band. Plain text; `introHtml` wins when both are set. */
32
31
  intro?: readonly string[];
32
+ /** The intro paragraphs as site-rendered HTML (inline emphasis); each renders inside its own `<p>`. */
33
+ introHtml?: readonly TrustedHtml[];
33
34
  eras: readonly EraDefinition[];
34
35
  people: readonly HubPerson[];
35
- /** People-focused line per era id, shown after the era intro. */
36
+ /** People-focused line per era id, shown after the era intro. Plain text; `eraNotesHtml` wins per era. */
36
37
  eraNotes?: Record<string, string>;
38
+ /** The era notes as site-rendered HTML (inline emphasis), keyed by era id. */
39
+ eraNotesHtml?: Record<string, TrustedHtml>;
37
40
  indexLabel?: string;
38
41
  timelineLabel?: string;
39
42
  footstepsHeading?: string;
@@ -43,24 +46,28 @@ const {
43
46
  title,
44
47
  lede,
45
48
  intro = [],
49
+ introHtml,
46
50
  eras,
47
51
  people,
48
52
  eraNotes = {},
53
+ eraNotesHtml = {},
49
54
  indexLabel = LABELS.peopleHub.indexLabel,
50
55
  timelineLabel,
51
56
  footstepsHeading = LABELS.peopleHub.footstepsHeading,
52
57
  } = Astro.props;
53
58
 
59
+ const introParagraphs = introHtml ?? intro.map(textAsHtml);
60
+ const eraNote = (id: string) => eraNotesHtml[id] ?? (eraNotes[id] ? textAsHtml(eraNotes[id]) : undefined);
54
61
  const segments = layoutPeopleTimeline(eras, people);
55
62
  const sections = segments.map(({ era, dots }) => ({ era, group: dots }));
56
- const footsteps = footstepLinks(segments.map((s) => s.era), segments.flatMap((s) => s.dots));
63
+ const footsteps = footstepLinks(segments.map((s) => s.era));
57
64
  ---
58
65
 
59
66
  <div class="bg-muted/30 border-b border-border pt-12 pb-10" data-pagefind-body>
60
67
  <Container>
61
68
  <h1 class="max-w-measure text-3xl sm:text-4xl font-normal font-display text-foreground leading-tight text-balance">{title}</h1>
62
69
  {lede && <p class="mt-5 max-w-measure text-lg text-muted-foreground leading-relaxed">{lede}</p>}
63
- {intro.map((paragraph) => <p class="mt-4 max-w-measure text-base text-foreground leading-relaxed">{paragraph}</p>)}
70
+ {introParagraphs.map((html) => <p class="mt-4 max-w-measure text-base text-foreground leading-relaxed" set:html={html} />)}
64
71
  </Container>
65
72
  </div>
66
73
 
@@ -80,7 +87,7 @@ const footsteps = footstepLinks(segments.map((s) => s.era), segments.flatMap((s)
80
87
  <h2 id={`era-${era.id}-heading`} class="font-display text-2xl font-semibold text-foreground">{era.label}</h2>
81
88
  {era.hook && <p class="mt-2 max-w-measure font-display text-lg text-secondary">{era.hook}</p>}
82
89
  <p class="mt-3 max-w-measure text-base text-foreground leading-relaxed">{era.intro}</p>
83
- {eraNotes[era.id] && <p class="mt-3 max-w-measure text-base text-foreground leading-relaxed">{eraNotes[era.id]}</p>}
90
+ {eraNote(era.id) && <p class="mt-3 max-w-measure text-base text-foreground leading-relaxed" set:html={eraNote(era.id)} />}
84
91
  <div class="mt-6 grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
85
92
  {group.map((p) => (
86
93
  <PersonCard
@@ -25,22 +25,19 @@ export interface PeopleTimelineSegment<T extends PeopleTimelineEntry = PeopleTim
25
25
  }
26
26
 
27
27
  /**
28
- * The closing "footsteps" links: each era's dossiers (oldest era first), then each person's article, both deduped by
29
- * href. Eras without people are the caller's to leave out.
28
+ * The closing "footsteps" links: each era's dossiers, oldest era first, deduped by href. Eras without people are the
29
+ * caller's to leave out.
30
30
  */
31
- export function footstepLinks(
32
- eras: readonly EraDefinition[],
33
- people: readonly { article?: { label: string; href: string } }[],
34
- ): { label: string; href: string }[] {
31
+ export function footstepLinks(eras: readonly EraDefinition[]): { label: string; href: string }[] {
35
32
  const seen = new Set<string>();
36
33
  const links: { label: string; href: string }[] = [];
37
- const add = (link: { label: string; href: string } | undefined) => {
38
- if (!link || seen.has(link.href)) return;
39
- seen.add(link.href);
40
- links.push(link);
41
- };
42
- for (const era of orderEras(eras)) era.dossiers?.forEach(add);
43
- people.forEach((p) => add(p.article));
34
+ for (const era of orderEras(eras)) {
35
+ for (const link of era.dossiers ?? []) {
36
+ if (seen.has(link.href)) continue;
37
+ seen.add(link.href);
38
+ links.push(link);
39
+ }
40
+ }
44
41
  return links;
45
42
  }
46
43