@sarimarcus/content-sites-ui 0.50.0 → 0.51.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,15 @@
2
2
 
3
3
  All packages in the platform release in lockstep; entries are per release version.
4
4
 
5
+ ## 0.51.1 (2026-10-27)
6
+
7
+ - `ui`: `PeopleBand` throws a clear error when given a `pool` without `toLink`; `buildEraListing` takes its lastmod from core `maxDate`; the person page's era timeline orders people with `groupByEra`. No rendered change on Córdoba or Granada (proof.mjs: byte-identical, no `--allow`) (SLA-3536).
8
+
9
+ ## 0.51.0 (2026-10-27)
10
+
11
+ - `core`: `createPeople({load, url, portraits})` (`toPersonLink`, `resolvePeople`, `personPortrait`, `personHref`) and `roleLabel`; `dossiersFromHubs(hubMap, ...keys)` in `eras`; `pagedTopicMeta` and `pagedEraMeta` (required `labelNamesCity`) in `text`.
12
+ - `ui`: new editorial `PeopleChips`, `PeopleBand`, `ArticleEraPeople`, `DossierSection` (`layout` `cards`|`chunked`), `ChronologyPage` + `buildChronology`, `PersonRoutePage` + `buildPersonPaths`/`buildPersonModel`, `EraListingRoute` + `buildEraListing`; `seo/ArticleMetadata` takes `era`/`eraBasePath` and places the era chip beside the byline. Every promoted piece renders byte-identical HTML to the Córdoba and Granada copies it replaces (proof.mjs: Córdoba 801/801 pages, Granada 670/670). New label groups `peopleChips`, `peopleBand`, `dossierSection`, `eraListing`, `personRoute`. The unused `cards` layout adds 3 utility rules (`mt-20`, `lg:-mx-16`, `xl:-mx-40`) to a site that does not use it (SLA-3333).
13
+
5
14
  ## 0.50.0 (2026-10-27)
6
15
 
7
16
  - `editorial`: new `EraPeopleRow`, the one compact row under an article intro: the era chip leads, then up to `visible` (default 3) name-only person chips, the rest behind a native `<details>` "+N more"; without an era a "People:" label leads. `EraChip` and `PersonChip` take an optional `size` (`sm`|`md`, default `md`, unchanged) and `PersonChip` a `showDates` (default true; dates stay in the accessible name). Defaults render identically to 0.49.4 (`tests/fixtures/render-diff/era-person-chip-defaults.json`). New label group `eraPeopleRow` (SLA-3535).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sarimarcus/content-sites-ui",
3
- "version": "0.50.0",
3
+ "version": "0.51.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",
@@ -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.50.0"
53
+ "@sarimarcus/content-sites-core": "0.51.1"
54
54
  }
55
55
  }
@@ -0,0 +1,26 @@
1
+ ---
2
+ /** ArticleEraPeople — the one era + people row under an article intro (EraPeopleRow); nothing without either. */
3
+ import EraPeopleRow from './EraPeopleRow.astro';
4
+ import type { PersonLink } from '@sarimarcus/content-sites-core/people';
5
+ import Container from '../layout/Container.astro';
6
+ import type { EraDefinition } from '@sarimarcus/content-sites-core/eras';
7
+
8
+ type Person = Pick<PersonLink, 'name' | 'href' | 'dates'>;
9
+
10
+ interface Props {
11
+ era?: EraDefinition;
12
+ eraBasePath?: string;
13
+ /** Already resolved by the site. */
14
+ people?: readonly Person[];
15
+ }
16
+
17
+ const { era, eraBasePath, people = [] } = Astro.props;
18
+ ---
19
+
20
+ {(era || people.length > 0) && (
21
+ <div class="pb-4" data-pagefind-ignore>
22
+ <Container size="measure">
23
+ <EraPeopleRow era={era} eraBasePath={eraBasePath} people={people} />
24
+ </Container>
25
+ </div>
26
+ )}
@@ -0,0 +1,46 @@
1
+ ---
2
+ /**
3
+ * ChronologyPage — the body of a site's /chronology: header band, then EraScenes as a timeline. The route keeps the
4
+ * site Layout, SEO and JSON-LD (build the rows with `buildChronology`); title, intro and the optional people link
5
+ * arrive as props. Slots:
6
+ * breadcrumb — the site Breadcrumb, in the band above the header.
7
+ */
8
+ import type { EraDefinition } from '@sarimarcus/content-sites-core/eras';
9
+ import BreadcrumbBand from '../layout/BreadcrumbBand.astro';
10
+ import Container from '../layout/Container.astro';
11
+ import LinkArrow from '../primitives/LinkArrow.astro';
12
+ import EraScenes from './EraScenes.astro';
13
+ import type { SceneItem } from './chronology';
14
+
15
+ interface Props {
16
+ heading: string;
17
+ intro: string;
18
+ /** A line under the intro, e.g. a link to the people hub. */
19
+ link?: { href: string; label: string };
20
+ eras: readonly EraDefinition[];
21
+ items: Record<string, readonly SceneItem[]>;
22
+ articleLimit?: number;
23
+ articleListings?: Record<string, { href: string; count: number }>;
24
+ }
25
+
26
+ const { heading, intro, link, eras, items, articleLimit = 5, articleListings = {} } = Astro.props;
27
+ ---
28
+
29
+ <BreadcrumbBand ignore={false}><slot name="breadcrumb" /></BreadcrumbBand>
30
+
31
+ <main>
32
+ <div class="bg-muted/30 border-b border-border pt-12 pb-10" data-pagefind-body>
33
+ <Container>
34
+ <h1 class="max-w-measure text-3xl sm:text-4xl font-normal font-display text-foreground leading-tight text-balance">{heading}</h1>
35
+ <div class="mt-4 flex">
36
+ <span class="block h-0.5 w-16 rounded-full bg-accent"></span>
37
+ </div>
38
+ <p class="mt-5 max-w-measure text-lg text-muted-foreground leading-relaxed">{intro}</p>
39
+ {link && <><p class="mt-4"><LinkArrow href={link.href}>{link.label}</LinkArrow></p>{' '}</>}
40
+ </Container>
41
+ </div>
42
+
43
+ <div class="py-12 lg:py-20" data-pagefind-body>
44
+ <EraScenes eras={eras} items={items} articleLimit={articleLimit} articleListings={articleListings} indexStyle="timeline" />
45
+ </div>
46
+ </main>
@@ -0,0 +1,103 @@
1
+ ---
2
+ /**
3
+ * DossierSection — the complete article set of one topic cluster, under a heading and an optional framing deck.
4
+ * Not sliced: a dossier lists every member. The site adapter owns the query and sorting and passes `items`, already
5
+ * mapped to related-content cards (a `theme` on an entry drives the `cards` grouping).
6
+ * layout="cards" — wide module (breaks out of the prose column), theme sub-groups past 6 entries, optional
7
+ * "view all" link.
8
+ * layout="chunked" — prose-width section, fixed runs of 4 cards separated by dividers.
9
+ */
10
+ import RelatedContent from '../composed/RelatedContent.astro';
11
+ import ArrowLabel from '../primitives/ArrowLabel.astro';
12
+ import SectionDivider from '../primitives/SectionDivider.astro';
13
+ import { LABELS } from '../internal/labels';
14
+ import { DOSSIER_MAX_RUN, chunk, dossierCards, groupDossier, type DossierEntry } from './dossier';
15
+
16
+ interface Props {
17
+ cluster: string;
18
+ title: string;
19
+ items: DossierEntry[];
20
+ layout?: 'cards' | 'chunked';
21
+ /** Defaults to 2 for `cards`, 3 for `chunked`. */
22
+ columns?: 2 | 3;
23
+ viewAllHref?: string;
24
+ viewAllLabel?: string;
25
+ themeLabels?: Record<string, string>;
26
+ fallbackTitle?: string;
27
+ }
28
+
29
+ const {
30
+ cluster,
31
+ title,
32
+ items,
33
+ layout = 'cards',
34
+ columns = layout === 'chunked' ? 3 : 2,
35
+ viewAllHref,
36
+ viewAllLabel = LABELS.dossierSection.viewAllLabel,
37
+ themeLabels = LABELS.dossierSection.themeLabels,
38
+ fallbackTitle = LABELS.dossierSection.fallbackTitle,
39
+ } = Astro.props;
40
+
41
+ if (items.length === 0) {
42
+ console.warn(`DossierSection: cluster "${cluster}" matched 0 articles on ${Astro.url.pathname} — nothing rendered.`);
43
+ }
44
+
45
+ const headingId = `dossier-${cluster}`;
46
+ const trackingBlock = `dossier_${cluster.replace(/-/g, '_')}`;
47
+ const cards = dossierCards(items);
48
+ const groups = layout === 'cards' ? groupDossier(items, themeLabels, fallbackTitle) : undefined;
49
+ const chunks = layout === 'chunked' ? chunk(cards, DOSSIER_MAX_RUN) : [];
50
+
51
+ // Rendered, not probed with slots.has(): that is true whenever a parent forwards its slot, filled or not.
52
+ const framing = layout === 'cards' ? ((Astro.slots.has('default') ? await Astro.slots.render('default') : '') ?? '') : '';
53
+ const hasFraming = framing.trim().length > 0;
54
+ const subHeadingClass = 'text-xl font-normal font-display text-foreground';
55
+ ---
56
+
57
+ {items.length > 0 && layout === 'chunked' && (
58
+ <section id={headingId} class="py-12 scroll-mt-24">
59
+ <h2 class="text-2xl sm:text-3xl font-medium mb-6 font-display text-foreground">{title}</h2>
60
+ <div class="max-w-measure text-muted-foreground mb-8 leading-relaxed"><slot /></div>
61
+ {chunks.map((chunk, i) => (
62
+ <>
63
+ {i > 0 && <SectionDivider variant="line" class="my-8" />}
64
+ <RelatedContent items={chunk} variant="card" columns={columns} trackingBlock={trackingBlock} />
65
+ </>
66
+ ))}
67
+ </section>
68
+ )}{items.length > 0 && layout === 'cards' && (
69
+ <>{' '}<section class:list={['mt-20', 'mb-16']} aria-labelledby={headingId}>
70
+ {/* Whitespace parity with the legacy site markup: the build output stays byte-identical. */}
71
+ <div class="lg:-mx-16 xl:-mx-40">
72
+ <h2 id={headingId} class="text-3xl font-normal font-display text-foreground mb-3">{title}</h2>
73
+
74
+ {hasFraming && (
75
+ <p class="text-muted-foreground leading-relaxed max-w-measure mb-8" set:html={framing} />
76
+ )}
77
+
78
+ {groups ? (
79
+ groups.map((group, i) => (
80
+ <div>
81
+ {group.title ? (
82
+ <h3 id={`${headingId}-g${i}`} class:list={[subHeadingClass, i > 0 && 'mt-10', 'mb-4']}>{group.title}</h3>
83
+ ) : (
84
+ i > 0 && <SectionDivider variant="line" />
85
+ )}
86
+ <RelatedContent items={group.items} variant="plain" columns={columns} trackingBlock={trackingBlock} />
87
+ </div>
88
+ ))
89
+ ) : (
90
+ <RelatedContent items={cards} variant="plain" columns={columns} trackingBlock={trackingBlock} />
91
+ )}
92
+
93
+ {/* Whitespace parity, as above. */}
94
+ {viewAllHref && (
95
+ <p class="mt-6">
96
+ <a href={viewAllHref} class="group text-sm font-medium text-primary hover:text-primary-strong transition-colors">
97
+ <ArrowLabel>{viewAllLabel}</ArrowLabel>
98
+ </a>
99
+ </p>
100
+ )}
101
+ </div>
102
+ </section></>
103
+ )}
@@ -0,0 +1,51 @@
1
+ ---
2
+ /**
3
+ * EraListingRoute — the body of an era listing route (/articles/era/<id>, and its page 2+): breadcrumb, EraListingPage
4
+ * with the count line and the timeline link. The route keeps getStaticPaths, the data, the site Layout, the
5
+ * StructuredData and the rel prev/next links; build them from `buildEraListing` (its `meta`, `collectionPage`,
6
+ * `breadcrumbs`, `prevHref`, `nextHref`) and pass the same model here. Slots:
7
+ * grid — the site's article card grid for this page.
8
+ * pagination — the site's pagination.
9
+ */
10
+ import type { ImageMetadata } from 'astro';
11
+ import type { EraDefinition } from '@sarimarcus/content-sites-core/eras';
12
+ import Breadcrumb from '../seo/Breadcrumb.astro';
13
+ import LinkArrow from '../primitives/LinkArrow.astro';
14
+ import EraListingPage from './EraListingPage.astro';
15
+ import type { EraListingModel } from './era-listing';
16
+
17
+ interface Props {
18
+ listing: EraListingModel;
19
+ era: EraDefinition;
20
+ intro: string;
21
+ hero?: ImageMetadata;
22
+ /** Place named in the hero alt ("<era> in <place>, <range>"). */
23
+ place: string;
24
+ }
25
+
26
+ const { listing, era, intro, hero, place } = Astro.props;
27
+ const { first, page, heading, trail, count, timelineHref, labels: L } = listing;
28
+ ---
29
+
30
+ <EraListingPage
31
+ eyebrow={L.eyebrow(era.label)}
32
+ heading={heading}
33
+ lede={era.hook ?? intro}
34
+ era={era}
35
+ hero={first && hero ? { image: hero, alt: L.heroAlt(era.label, place, era.rangeLabel) } : undefined}
36
+ currentPage={page}
37
+ listHeading={first ? L.listHeading(era.label) : undefined}
38
+ >
39
+ <Breadcrumb slot="breadcrumb" items={trail} />
40
+ <Fragment slot="header-extra">
41
+ <p class="mt-4 text-base text-muted-foreground leading-relaxed">{intro}</p>
42
+ <p class="mt-3 text-sm text-muted-foreground">
43
+ <span class="tabular-nums">{count}</span> {count === 1 ? L.articleOne : L.articleMany} · <span class="tabular-nums">{era.rangeLabel}</span>
44
+ </p>
45
+ </Fragment>
46
+ <slot name="grid" slot="grid" />
47
+ <slot name="pagination" slot="pagination" />
48
+ <p slot="go-deeper" class="mt-12">
49
+ <LinkArrow href={timelineHref}>{L.timelineLink(era.label)}</LinkArrow>
50
+ </p>
51
+ </EraListingPage>
@@ -5,16 +5,13 @@
5
5
  * there is neither an era nor a person. The sm chips are 28px tall; `hit` stretches each tap target to 44px.
6
6
  */
7
7
  import type { EraDefinition } from '@sarimarcus/content-sites-core/eras';
8
+ import type { PersonLink } from '@sarimarcus/content-sites-core/people';
8
9
  import EraChip from './EraChip.astro';
9
10
  import PersonChip from './PersonChip.astro';
10
11
  import { PILL_BASE } from '../primitives/pillRecipe';
11
12
  import { LABELS } from '../internal/labels';
12
13
 
13
- interface Person {
14
- name: string;
15
- href: string;
16
- dates?: string;
17
- }
14
+ type Person = Pick<PersonLink, 'name' | 'href' | 'dates'>;
18
15
 
19
16
  interface Props {
20
17
  era?: EraDefinition;
@@ -0,0 +1,78 @@
1
+ ---
2
+ /**
3
+ * PeopleBand — a hub band of person chips. Pass `people` (already resolved) or a `pool` of people entries filtered by
4
+ * `eras`/`roles`: the pool is picked round-robin across the eras, oldest-born first within each, then mapped by
5
+ * `toLink`. Renders nothing without a person.
6
+ */
7
+ import PersonChip from './PersonChip.astro';
8
+ import type { PersonLink } from '@sarimarcus/content-sites-core/people';
9
+ import { groupByEra } from './chronology';
10
+ import LinkArrow from '../primitives/LinkArrow.astro';
11
+ import { slugify } from '@sarimarcus/content-sites-core/text';
12
+ import { LABELS } from '../internal/labels';
13
+
14
+ type Person = Pick<PersonLink, 'name' | 'href' | 'dates'>;
15
+
16
+ interface PoolEntry {
17
+ data: { era?: string; roles: readonly string[]; birthYear?: number; deathYear?: number };
18
+ }
19
+
20
+ interface Props {
21
+ eras?: readonly string[];
22
+ roles?: readonly string[];
23
+ people?: readonly Person[];
24
+ pool?: readonly PoolEntry[];
25
+ toLink?: (data: any) => Person;
26
+ heading: string;
27
+ intro?: string;
28
+ max?: number;
29
+ allLabel?: string;
30
+ allHref: string;
31
+ }
32
+
33
+ const {
34
+ eras = [],
35
+ roles,
36
+ people: given,
37
+ pool: allPeople = [],
38
+ toLink,
39
+ heading,
40
+ intro,
41
+ max = 8,
42
+ allLabel = LABELS.peopleBand.allLabel,
43
+ allHref,
44
+ } = Astro.props;
45
+ let people: readonly Person[];
46
+ if (given) {
47
+ people = given.slice(0, max);
48
+ } else {
49
+ if (!toLink) throw new Error('PeopleBand: a pool needs toLink');
50
+ const pool = allPeople.filter(
51
+ (p) => eras.includes(p.data.era as string) && (!roles || p.data.roles.some((r) => roles.includes(r))),
52
+ );
53
+ const grouped = groupByEra(pool, (p) => p.data.era as string, (p) => p.data.birthYear ?? p.data.deathYear);
54
+ const lists = eras.map((era) => grouped[era] ?? []);
55
+ const picked: typeof pool[number][] = [];
56
+ for (let i = 0; picked.length < max && lists.some((list) => i < list.length); i++) {
57
+ for (const list of lists) if (i < list.length && picked.length < max) picked.push(list[i]);
58
+ }
59
+ const order = new Map(lists.flat().map((p, i) => [p, i]));
60
+ people = picked.sort((a, b) => order.get(a)! - order.get(b)!).map((p) => toLink(p.data));
61
+ }
62
+ const headingId = `people-band-${slugify(heading)}`;
63
+ ---
64
+
65
+ {people.length > 0 && (
66
+ <section class="mb-16" aria-labelledby={headingId}>
67
+ <div class="max-w-measure">
68
+ <h2 id={headingId} class="font-display text-2xl font-semibold text-foreground">{heading}</h2>
69
+ {intro && <p class="mt-3 text-muted-foreground leading-relaxed">{intro}</p>}
70
+ </div>
71
+ <ul class="mt-5 flex flex-wrap gap-2">
72
+ {people.map((p) => (
73
+ <li><PersonChip name={p.name} href={p.href} dates={p.dates} /></li>
74
+ ))}
75
+ </ul>
76
+ <p class="mt-5"><LinkArrow href={allHref}>{allLabel}</LinkArrow></p>
77
+ </section>
78
+ )}
@@ -0,0 +1,26 @@
1
+ ---
2
+ /** PeopleChips — "People in this story" chip list. The site resolves the people; nothing renders without any. */
3
+ import PersonChip from './PersonChip.astro';
4
+ import type { PersonLink } from '@sarimarcus/content-sites-core/people';
5
+ import { LABELS } from '../internal/labels';
6
+
7
+ type Person = Pick<PersonLink, 'name' | 'href' | 'dates'>;
8
+
9
+ interface Props {
10
+ people?: readonly Person[];
11
+ heading?: string;
12
+ }
13
+
14
+ const { people = [], heading = LABELS.peopleChips.heading } = Astro.props;
15
+ ---
16
+
17
+ {people.length > 0 && (
18
+ <section class="mb-8" aria-labelledby="people-chips-heading">
19
+ <h2 id="people-chips-heading" class="mb-3 text-sm font-semibold uppercase tracking-wide text-muted-foreground">{heading}</h2>
20
+ <ul class="flex flex-wrap gap-2">
21
+ {people.map((p) => (
22
+ <li><PersonChip name={p.name} href={p.href} dates={p.dates} /></li>
23
+ ))}
24
+ </ul>
25
+ </section>
26
+ )}
@@ -0,0 +1,76 @@
1
+ ---
2
+ /**
3
+ * PersonRoutePage — a person route's body: `buildPersonModel` over the injected collections, rendered through
4
+ * PersonPage. The route keeps `getStaticPaths` (`buildPersonPaths`), the site Layout, SEO and JSON-LD; the
5
+ * collections, card resolvers and the portrait map are passed in, never imported. Slots: `breadcrumb` (the site
6
+ * Breadcrumb), `before-body`, `after-body`, `tail`, forwarded to PersonPage.
7
+ */
8
+ import type { ImageMetadata } from 'astro';
9
+ import type { EraDefinition } from '@sarimarcus/content-sites-core/eras';
10
+ import type { PersonBacklink } from '@sarimarcus/content-sites-core/people';
11
+ import { parseMarkdown } from '@sarimarcus/content-sites-core/text';
12
+ import { routePath, routeSegment, url } from '@sarimarcus/content-sites-core/url';
13
+ import { trustedHtml } from '../types';
14
+ import PersonPage from './PersonPage.astro';
15
+ import { buildPersonModel, type PersonModelInput } from './person-page';
16
+
17
+ interface PersonFields {
18
+ slug: string;
19
+ name: string;
20
+ bio: string;
21
+ imageAlt: string;
22
+ era?: unknown;
23
+ roles: readonly string[];
24
+ birthYear?: number;
25
+ deathYear?: number;
26
+ circa?: boolean;
27
+ aliases?: readonly string[];
28
+ primaryArticle?: string;
29
+ }
30
+
31
+ type Props = Omit<PersonModelInput<any, any, any>, 'person' | 'links' | 'era'> & {
32
+ person: PersonFields;
33
+ links: readonly PersonBacklink[];
34
+ era?: EraDefinition;
35
+ roleLabel: (role: string) => string;
36
+ /** The site's base path, for relative links in the biography. */
37
+ basePath: string;
38
+ /** Where the era chip links; defaults to /chronology. */
39
+ eraBasePath?: string;
40
+ };
41
+
42
+ const { person, links, era, roleLabel, basePath, eraBasePath = url(`/${routeSegment('chronology')}`), ...model } = Astro.props;
43
+ const { places, readMore, primaryCard, timeline } = buildPersonModel({ ...model, person, links, era });
44
+ const image = model.personPortrait(person.slug);
45
+ const portrait: { image: ImageMetadata; imageAlt: string } | { image?: undefined } = image
46
+ ? { image: image as ImageMetadata, imageAlt: person.imageAlt }
47
+ : {};
48
+ ---
49
+
50
+ <PersonPage
51
+ name={person.name}
52
+ birthYear={person.birthYear}
53
+ deathYear={person.deathYear}
54
+ circa={person.circa}
55
+ aliases={person.aliases}
56
+ roles={person.roles.map(roleLabel)}
57
+ {...portrait}
58
+ era={era}
59
+ eraBasePath={eraBasePath}
60
+ bioHtml={trustedHtml(parseMarkdown(person.bio, basePath))}
61
+ fullStory={person.primaryArticle ? {
62
+ href: url(routePath('articles', person.primaryArticle)),
63
+ title: primaryCard?.title,
64
+ summary: primaryCard?.description,
65
+ image: primaryCard?.image as ImageMetadata | undefined,
66
+ imageAlt: (primaryCard as { imageAlt?: string } | undefined)?.imageAlt,
67
+ } : undefined}
68
+ places={places}
69
+ readMore={readMore}
70
+ timeline={timeline}
71
+ >
72
+ <slot name="breadcrumb" slot="breadcrumb" />
73
+ <slot name="before-body" slot="before-body" />
74
+ <slot name="after-body" slot="after-body" />
75
+ <slot name="tail" slot="tail" />
76
+ </PersonPage>
@@ -0,0 +1,128 @@
1
+ import type { EraDefinition } from '@sarimarcus/content-sites-core/eras';
2
+ import { formatYearRange } from '@sarimarcus/content-sites-core/eras';
3
+ import { formatLifeDates } from '@sarimarcus/content-sites-core/people';
4
+ import { LABELS } from '../internal/labels';
5
+ import { groupByEra, type SceneItem } from './chronology';
6
+
7
+ interface Dated {
8
+ era?: unknown;
9
+ yearStart?: number | null;
10
+ yearEnd?: number | null;
11
+ datePublished?: string;
12
+ featured?: boolean;
13
+ }
14
+ interface PersonData {
15
+ slug: string;
16
+ name: string;
17
+ description?: string;
18
+ era?: unknown;
19
+ birthYear?: number;
20
+ deathYear?: number;
21
+ circa?: boolean;
22
+ roles: readonly string[];
23
+ }
24
+ type Card = { href: string; title: string; description?: string; eyebrow?: string; image?: SceneItem['image'] };
25
+ type Schema = 'Article' | 'TouristAttraction' | 'Person';
26
+
27
+ export interface ChronologyInput {
28
+ eras: readonly EraDefinition[];
29
+ /** Entries by type; the type is passed to `toCardItem` and `typeLabel`. */
30
+ sources: readonly (readonly ['monument' | 'article', readonly { data: Dated }[]])[];
31
+ people: readonly { data: PersonData }[];
32
+ toCardItem: (type: 'monument' | 'article', entry: never) => Card;
33
+ /** Kind label of a card with no eyebrow. */
34
+ typeLabel: (type: 'monument' | 'article') => string;
35
+ personHref: (slug: string) => string;
36
+ personPortrait: (slug: string) => SceneItem['image'] | undefined;
37
+ roleLabel: (role: string) => string;
38
+ personKind?: string;
39
+ /** Newest-first articles kept per era. */
40
+ articlesPerEra?: number;
41
+ }
42
+
43
+ export interface ChronologyModel {
44
+ items: Record<string, SceneItem[]>;
45
+ /** Every listed entry in page order, for the collection-page JSON-LD. */
46
+ listed: { item: SceneItem; schemaType: Schema }[];
47
+ }
48
+
49
+ interface Row {
50
+ era?: string;
51
+ year?: number;
52
+ published?: string;
53
+ schemaType: Schema;
54
+ item: SceneItem;
55
+ }
56
+
57
+ /** Rows per era: people and monuments by year, the most recently published articles first (capped). */
58
+ export function buildChronology({
59
+ eras,
60
+ sources,
61
+ people,
62
+ toCardItem,
63
+ typeLabel,
64
+ personHref,
65
+ personPortrait,
66
+ roleLabel,
67
+ personKind = LABELS.personRoute.personKind,
68
+ articlesPerEra = 5,
69
+ }: ChronologyInput): ChronologyModel {
70
+ const rows: Row[] = sources.flatMap(([type, entries]) =>
71
+ entries.map((entry) => {
72
+ const { href, title, description, eyebrow, image } = toCardItem(type, entry as never);
73
+ return {
74
+ era: entry.data.era as string | undefined,
75
+ year: entry.data.yearStart ?? undefined,
76
+ published: entry.data.datePublished,
77
+ schemaType: type === 'article' ? 'Article' : 'TouristAttraction',
78
+ item: {
79
+ type,
80
+ title,
81
+ href,
82
+ kind: eyebrow ?? typeLabel(type),
83
+ yearLabel: formatYearRange(entry.data.yearStart ?? undefined, entry.data.yearEnd ?? undefined),
84
+ description,
85
+ image,
86
+ year: entry.data.yearStart ?? undefined,
87
+ featured: entry.data.featured,
88
+ },
89
+ } satisfies Row;
90
+ }),
91
+ );
92
+
93
+ const personRows: Row[] = people.map((p) => ({
94
+ era: p.data.era as string | undefined,
95
+ year: p.data.birthYear ?? p.data.deathYear,
96
+ schemaType: 'Person',
97
+ item: {
98
+ type: 'person',
99
+ title: p.data.name,
100
+ href: personHref(p.data.slug),
101
+ kind: personKind,
102
+ yearLabel: formatLifeDates(p.data),
103
+ description: p.data.description,
104
+ image: personPortrait(p.data.slug),
105
+ year: p.data.birthYear ?? p.data.deathYear,
106
+ roles: p.data.roles.map(roleLabel),
107
+ },
108
+ }));
109
+
110
+ const byEra = (list: Row[]) => groupByEra(list, (r) => r.era, (r) => r.year, (r) => r.item.title);
111
+ const monumentsByEra = byEra(rows.filter((r) => r.schemaType === 'TouristAttraction'));
112
+ const articlesByEra = byEra(rows.filter((r) => r.schemaType === 'Article'));
113
+ const peopleByEra = byEra(personRows);
114
+ const newestFirst = (a: Row, b: Row) => (b.published ?? '').localeCompare(a.published ?? '');
115
+ const grouped: Record<string, readonly Row[]> = Object.fromEntries(
116
+ eras
117
+ .map((e) => [e.id, [
118
+ ...(peopleByEra[e.id] ?? []),
119
+ ...(monumentsByEra[e.id] ?? []),
120
+ ...(articlesByEra[e.id] ?? []).sort(newestFirst).slice(0, articlesPerEra),
121
+ ]] as const)
122
+ .filter(([, list]) => list.length),
123
+ );
124
+ return {
125
+ items: Object.fromEntries(Object.entries(grouped).map(([era, list]) => [era, list.map((r) => r.item)])),
126
+ listed: eras.flatMap((e) => grouped[e.id] ?? []),
127
+ };
128
+ }
@@ -0,0 +1,59 @@
1
+ import type { RelatedItem } from '../composed/related';
2
+
3
+ /** A dossier card plus the primary theme the grouping reads. */
4
+ export type DossierEntry = RelatedItem & { theme?: string | null };
5
+
6
+ export interface DossierGroup {
7
+ title?: string;
8
+ items: RelatedItem[];
9
+ }
10
+
11
+ export const DOSSIER_GROUP_THRESHOLD = 6;
12
+ export const DOSSIER_MAX_RUN = 4;
13
+
14
+ const card = ({ theme: _theme, ...item }: DossierEntry): RelatedItem => item;
15
+
16
+ /** Consecutive runs of at most `size` items; `[]` for an empty list. */
17
+ export function chunk<T>(items: readonly T[], size: number): T[][] {
18
+ const out: T[][] = [];
19
+ for (let i = 0; i < items.length; i += size) out.push(items.slice(i, i + size));
20
+ return out;
21
+ }
22
+
23
+ const toRuns = (groups: DossierGroup[]): DossierGroup[] =>
24
+ groups.flatMap((group) => chunk(group.items, DOSSIER_MAX_RUN).map((items, i) => ({ title: i === 0 ? group.title : undefined, items })));
25
+
26
+ /**
27
+ * Large dossiers split into theme sub-groups (largest theme first, then key); singleton and theme-less entries
28
+ * collapse into a trailing fallback group, and every group is cut into runs of at most 4. A single-theme dossier
29
+ * is chunked in order with no headings. Returns undefined when the flat grid applies.
30
+ */
31
+ export function groupDossier(
32
+ entries: readonly DossierEntry[],
33
+ themeLabels: Readonly<Record<string, string>>,
34
+ fallbackTitle: string,
35
+ ): DossierGroup[] | undefined {
36
+ if (entries.length <= DOSSIER_GROUP_THRESHOLD) return undefined;
37
+ const themed = new Map<string, DossierEntry[]>();
38
+ const fallback: DossierEntry[] = [];
39
+ for (const entry of entries) {
40
+ if (!entry.theme) {
41
+ fallback.push(entry);
42
+ continue;
43
+ }
44
+ const bucket = themed.get(entry.theme);
45
+ if (bucket) bucket.push(entry);
46
+ else themed.set(entry.theme, [entry]);
47
+ }
48
+ const ordered = [...themed.entries()].sort((a, b) => b[1].length - a[1].length || a[0].localeCompare(b[0]));
49
+ const candidate: DossierGroup[] = ordered
50
+ .filter(([, list]) => list.length > 1)
51
+ .map(([theme, list]) => ({ title: themeLabels[theme] ?? theme, items: list.map(card) }));
52
+ fallback.push(...ordered.filter(([, list]) => list.length <= 1).flatMap(([, list]) => list));
53
+ if (fallback.length > 0) candidate.push({ title: fallbackTitle, items: fallback.map(card) });
54
+ if (candidate.length > 1) return toRuns(candidate);
55
+ const chunks = chunk(entries.map(card), DOSSIER_MAX_RUN).map((items) => ({ items }));
56
+ return chunks.length > 1 ? chunks : undefined;
57
+ }
58
+
59
+ export const dossierCards = (entries: readonly DossierEntry[]): RelatedItem[] => entries.map(card);
@@ -0,0 +1,77 @@
1
+ import type { EraDefinition } from '@sarimarcus/content-sites-core/eras';
2
+ import { maxDate } from '@sarimarcus/content-sites-core/dates';
3
+ import { toAbsoluteSiteUrl, url } from '@sarimarcus/content-sites-core/url';
4
+ import { LABELS } from '../internal/labels';
5
+
6
+ interface ArticleLike {
7
+ data: { slug: string; title: string; description?: string; dateModified?: string; datePublished?: string };
8
+ }
9
+
10
+ export interface EraListingInput {
11
+ era: EraDefinition;
12
+ copy: { h1: string; seoTitle: string; description: string };
13
+ /** Every article of the era; the count and lastmod come from it. */
14
+ eraArticles: readonly ArticleLike[];
15
+ pageArticles: readonly ArticleLike[];
16
+ page: number;
17
+ totalPages: number;
18
+ siteUrl: string;
19
+ /** The site base path (`import.meta.env.BASE_URL`). */
20
+ basePath: string;
21
+ /** Era hub path, without base. */
22
+ hubPath: string;
23
+ articlesHref: string;
24
+ articleHref: (slug: string) => string;
25
+ chronologyHref: string;
26
+ /** Title and description of page 2+ (page 1 uses `copy`). */
27
+ pagedMeta?: { title: string; description: string };
28
+ labels?: Partial<typeof LABELS.eraListing>;
29
+ }
30
+
31
+ /** The head data and strings of an era listing route; `EraListingRoute` renders the body from it. */
32
+ export function buildEraListing(input: EraListingInput) {
33
+ const { era, copy, eraArticles, pageArticles, page, totalPages, siteUrl: rawSiteUrl, basePath, hubPath, articlesHref, articleHref, chronologyHref, pagedMeta } = input;
34
+ const L = { ...LABELS.eraListing, ...input.labels };
35
+ const first = page === 1;
36
+ if (!first && !pagedMeta) throw new Error(`buildEraListing: page ${page} of ${hubPath} needs pagedMeta`);
37
+ const siteUrl = rawSiteUrl.replace(/\/$/, '');
38
+ const pagePath = (n: number) => (n <= 1 ? hubPath : `${hubPath}/page/${n}`);
39
+ const abs = (path: string) => toAbsoluteSiteUrl(url(path, basePath), siteUrl, basePath);
40
+ const lastmod = maxDate(...eraArticles.map((a) => a.data.dateModified || a.data.datePublished || ''));
41
+ const heading = first ? copy.h1 : `${copy.h1} (${L.pageLabel(page)})`;
42
+ const items = pageArticles.map((a) => ({
43
+ name: a.data.title,
44
+ url: articleHref(a.data.slug),
45
+ description: a.data.description,
46
+ schemaType: L.articleSchemaType,
47
+ }));
48
+ const breadcrumbs = [
49
+ { name: L.homeLabel, url: abs('/') },
50
+ { name: L.articlesLabel, url: abs(articlesHref) },
51
+ { name: era.label, url: abs(hubPath) },
52
+ ...(first ? [] : [{ name: L.pageLabel(page), url: abs(pagePath(page)) }]),
53
+ ];
54
+ const collectionPage = first
55
+ ? { name: copy.h1, description: copy.description, url: hubPath, dateModified: lastmod, items }
56
+ : { name: heading, description: copy.description, url: pagePath(page), items };
57
+ const trail = first
58
+ ? [{ name: L.articlesLabel, url: articlesHref }, { name: era.label }]
59
+ : [{ name: L.articlesLabel, url: articlesHref }, { name: era.label, url: hubPath }, { name: L.pageLabel(page) }];
60
+ return {
61
+ first,
62
+ page,
63
+ heading,
64
+ /** Props for the route's `<Layout>`. */
65
+ meta: first ? { title: copy.seoTitle, description: copy.description } : pagedMeta!,
66
+ collectionPage,
67
+ breadcrumbs,
68
+ prevHref: first ? undefined : abs(pagePath(page - 1)),
69
+ nextHref: page < totalPages ? abs(pagePath(page + 1)) : undefined,
70
+ trail,
71
+ count: eraArticles.length,
72
+ timelineHref: url(`${chronologyHref}#${era.anchor}`, basePath),
73
+ labels: L,
74
+ };
75
+ }
76
+
77
+ export type EraListingModel = ReturnType<typeof buildEraListing>;
@@ -38,6 +38,9 @@ export { default as AlsoExplore } from './AlsoExplore.astro';
38
38
  export { default as VisitTiming } from './VisitTiming.astro';
39
39
  export { default as ChronologyTimeline } from './ChronologyTimeline.astro';
40
40
  export { groupByEra, type TimelineItem } from './chronology';
41
+ export { default as PeopleChips } from './PeopleChips.astro';
42
+ export { default as PeopleBand } from './PeopleBand.astro';
43
+ export { default as ArticleEraPeople } from './ArticleEraPeople.astro';
41
44
  export { default as PeopleHub } from './PeopleHub.astro';
42
45
  export { default as EraTimelineNav } from './EraTimelineNav.astro';
43
46
  export { default as PeopleTimeline } from './PeopleTimeline.astro';
@@ -57,3 +60,11 @@ export { default as DidYouKnow } from './interludes/DidYouKnow.astro';
57
60
  export { default as RelatedCard } from './interludes/RelatedCard.astro';
58
61
  export { default as Interlude } from './interludes/Interlude.astro';
59
62
  export type { InterludeData, InterludeLabels, RenderInline } from './interludes/types';
63
+ export { default as ChronologyPage } from './ChronologyPage.astro';
64
+ export { buildChronology, type ChronologyInput, type ChronologyModel } from './chronology-page';
65
+ export { default as PersonRoutePage } from './PersonRoutePage.astro';
66
+ export { buildPersonPaths, buildPersonModel, type PersonModelInput, type PersonSources } from './person-page';
67
+ export { default as DossierSection } from './DossierSection.astro';
68
+ export { groupDossier, type DossierEntry, type DossierGroup } from './dossier';
69
+ export { default as EraListingRoute } from './EraListingRoute.astro';
70
+ export { buildEraListing, type EraListingInput, type EraListingModel } from './era-listing';
@@ -0,0 +1,129 @@
1
+ import type { EraDefinition } from '@sarimarcus/content-sites-core/eras';
2
+ import { formatYearRange } from '@sarimarcus/content-sites-core/eras';
3
+ import { buildPersonBacklinks, formatLifeDates, type PersonBacklink } from '@sarimarcus/content-sites-core/people';
4
+ import type { RelatedItem } from '../composed/related';
5
+ import { LABELS } from '../internal/labels';
6
+ import { groupByEra, type TimelineItem } from './chronology';
7
+
8
+ type PersonType = string;
9
+ interface Linked {
10
+ data: { slug: string; people?: readonly string[] };
11
+ }
12
+ interface PersonEntry {
13
+ data: {
14
+ slug: string;
15
+ name: string;
16
+ description?: string;
17
+ era?: string;
18
+ birthYear?: number;
19
+ deathYear?: number;
20
+ circa?: boolean;
21
+ };
22
+ }
23
+
24
+ /** `[type, entries]` pairs whose items can cite people, in backlink order. */
25
+ export type PersonSources<E extends Linked> = readonly (readonly [PersonType, readonly E[]])[];
26
+
27
+ /**
28
+ * The static paths of a person route: one per person, with its backlinks and the cards of the items that cite it
29
+ * (`toCardItem` is the site's resolver, so the card type stays the site's).
30
+ */
31
+ export function buildPersonPaths<D extends { slug: string }, E extends Linked, C>(
32
+ people: readonly { data: D }[],
33
+ sources: PersonSources<E>,
34
+ toCardItem: (type: string, entry: E) => C,
35
+ ) {
36
+ const bySlug = new Map<string, { type: string; entry: E }>();
37
+ const items = sources.flatMap(([type, list]) =>
38
+ list.map((entry) => {
39
+ bySlug.set(`${type}:${entry.data.slug}`, { type, entry });
40
+ return { type, slug: entry.data.slug, people: entry.data.people };
41
+ }),
42
+ );
43
+ const backlinks = buildPersonBacklinks(items);
44
+ return people.map((person) => {
45
+ const links: PersonBacklink[] = backlinks[person.data.slug] ?? [];
46
+ const entries: Record<string, C> = {};
47
+ for (const link of links) {
48
+ const key = `${link.type}:${link.slug}`;
49
+ const source = bySlug.get(key)!;
50
+ entries[key] = toCardItem(source.type, source.entry);
51
+ }
52
+ return { params: { slug: person.data.slug }, props: { person: person.data, links, entries } };
53
+ });
54
+ }
55
+
56
+ interface CardLike {
57
+ href: string;
58
+ title: string;
59
+ description?: string;
60
+ eyebrow?: string;
61
+ image?: TimelineItem['image'];
62
+ }
63
+
64
+ export interface PersonModelInput<A extends { data: { slug: string; dateModified?: unknown } }, M extends { data: { era?: string; yearStart?: number; yearEnd?: number } }, Pe extends PersonEntry> {
65
+ person: { slug: string; era?: unknown; primaryArticle?: string };
66
+ links: readonly PersonBacklink[];
67
+ entries: Record<string, CardLike>;
68
+ articles: readonly A[];
69
+ monuments: readonly M[];
70
+ people: readonly Pe[];
71
+ era: EraDefinition | undefined;
72
+ toRelatedItem: (card: never) => RelatedItem;
73
+ toCardItem: (type: string, entry: never) => CardLike;
74
+ personPortrait: (slug: string) => TimelineItem['image'] | undefined;
75
+ personHref: (slug: string) => string;
76
+ /** Link types rendered as places (the rest is ignored, articles go to read more). */
77
+ placeTypes?: readonly string[];
78
+ /** The era timeline's section kinds. */
79
+ monumentKind?: string;
80
+ personKind?: string;
81
+ timelineLimit?: number;
82
+ }
83
+
84
+ /** Everything PersonPage needs beyond the person's own fields. */
85
+ export function buildPersonModel<A extends { data: { slug: string; dateModified?: unknown } }, M extends { data: { era?: string; yearStart?: number; yearEnd?: number } }, Pe extends PersonEntry>(
86
+ input: PersonModelInput<A, M, Pe>,
87
+ ) {
88
+ const {
89
+ person, links, entries, articles, monuments, people, era, toRelatedItem, toCardItem, personPortrait, personHref,
90
+ placeTypes = ['monument', 'museum', 'neighborhood', 'walk'],
91
+ monumentKind = LABELS.personRoute.monumentKind,
92
+ personKind = LABELS.personRoute.personKind,
93
+ timelineLimit = 5,
94
+ } = input;
95
+ const related = (link: PersonBacklink) => toRelatedItem(entries[`${link.type}:${link.slug}`] as never);
96
+ const places = links
97
+ .filter((link) => placeTypes.includes(link.type) && !(link.type === 'article' && link.slug === person.primaryArticle))
98
+ .map(related);
99
+ const modified = new Map(articles.map((a) => [a.data.slug, String(a.data.dateModified)]));
100
+ const readMore = links
101
+ .filter((link) => link.type === 'article' && link.slug !== person.primaryArticle)
102
+ .sort((a, b) => (modified.get(b.slug) ?? '').localeCompare(modified.get(a.slug) ?? ''))
103
+ .map(related);
104
+ const primary = articles.find((a) => a.data.slug === person.primaryArticle);
105
+ const primaryCard = primary ? toCardItem('article', primary as never) : undefined;
106
+
107
+ const byYear = (a: number | undefined, b: number | undefined) => (a ?? 0) - (b ?? 0);
108
+ const eraItems: TimelineItem[] = era
109
+ ? [
110
+ ...monuments
111
+ .filter((m) => m.data.era === era.id)
112
+ .sort((a, b) => byYear(a.data.yearStart, b.data.yearStart))
113
+ .slice(0, timelineLimit)
114
+ .map((m) => {
115
+ const card = toCardItem('monument', m as never);
116
+ return { title: card.title, href: card.href, kind: card.eyebrow ?? monumentKind, yearLabel: formatYearRange(m.data.yearStart, m.data.yearEnd), description: card.description, image: card.image };
117
+ }),
118
+ ...(groupByEra(people.filter((p) => p.data.slug !== person.slug), (p) => p.data.era, (p) => p.data.birthYear ?? p.data.deathYear)[era.id] ?? [])
119
+ .slice(0, timelineLimit)
120
+ .map((p) => ({ title: p.data.name, href: personHref(p.data.slug), kind: personKind, yearLabel: formatLifeDates(p.data), description: p.data.description, image: personPortrait(p.data.slug) })),
121
+ ]
122
+ : [];
123
+ return {
124
+ places,
125
+ readMore,
126
+ primaryCard,
127
+ timeline: era && eraItems.length ? { eras: [era], items: { [era.id]: eraItems } } : undefined,
128
+ };
129
+ }
@@ -85,6 +85,8 @@ export const LABELS = {
85
85
  personChip: { ariaLabel: (name: string, dates?: string) => `${name}${dates ? `, ${dates}` : ''}: read their profile` },
86
86
  eraPeopleRow: { peopleLabel: 'People:', more: (n: number) => `+${n} more`, moreSr: ' people' },
87
87
  personCard: { cta: 'Read the profile' },
88
+ peopleChips: { heading: 'People in this story' },
89
+ peopleBand: { allLabel: 'All historical figures' },
88
90
  peopleTimeline: {
89
91
  ariaLabel: 'People by era',
90
92
  approximate: 'date unknown, placed mid-era',
@@ -95,6 +97,7 @@ export const LABELS = {
95
97
  footstepsHeading: 'Walk in their footsteps',
96
98
  placesHeading: 'Where to find them',
97
99
  },
100
+ personRoute: { monumentKind: 'Monument', personKind: 'Historical figure' },
98
101
  personPage: {
99
102
  readFullStory: 'Read the full story',
100
103
  fullStoryHeading: 'The full story',
@@ -150,4 +153,33 @@ export const LABELS = {
150
153
  allArticlesLabel: (count: number) => `All ${count} articles`,
151
154
  portraitAlt: (name: string) => `Portrait of ${name}`,
152
155
  },
156
+ dossierSection: {
157
+ viewAllLabel: 'View all',
158
+ fallbackTitle: 'More from this dossier',
159
+ themeLabels: {
160
+ gastronomy: 'Gastronomy',
161
+ nightlife: 'Nightlife',
162
+ history: 'History',
163
+ religious: 'Religious heritage',
164
+ architecture: 'Architecture',
165
+ art: 'Art',
166
+ nature: 'Nature',
167
+ entertainment: 'Entertainment',
168
+ shopping: 'Shopping',
169
+ wellness: 'Wellness',
170
+ cultural: 'Cultural',
171
+ } as Record<string, string>,
172
+ },
173
+ eraListing: {
174
+ homeLabel: 'Home',
175
+ articlesLabel: 'Articles',
176
+ articleSchemaType: 'Article',
177
+ eyebrow: (era: string) => `Articles · ${era}`,
178
+ listHeading: (era: string) => `Articles on ${era}`,
179
+ heroAlt: (era: string, place: string, range: string) => `${era} in ${place}, ${range}`,
180
+ articleOne: 'article',
181
+ articleMany: 'articles',
182
+ pageLabel: (page: number) => `Page ${page}`,
183
+ timelineLink: (era: string) => `See ${era} on the timeline, with its people and monuments`,
184
+ },
153
185
  };
@@ -15,6 +15,8 @@
15
15
  */
16
16
  import { Image } from 'astro:assets';
17
17
  import { isUpdatedAfterPublication } from '@sarimarcus/content-sites-core/articles';
18
+ import type { EraDefinition } from '@sarimarcus/content-sites-core/eras';
19
+ import EraChip from '../editorial/EraChip.astro';
18
20
  import type { ArticleAuthor } from './types';
19
21
  import { LABELS } from '../internal/labels';
20
22
 
@@ -36,6 +38,10 @@ interface Props {
36
38
  updatedIconClass?: string;
37
39
  /** Whitespace compatibility only: 'grouped' compiles to the markup of a template that wraps the byline in a Fragment. */
38
40
  bylineWhitespace?: 'flat' | 'grouped';
41
+ /** With an era, its chip sits beside the byline. */
42
+ era?: EraDefinition;
43
+ /** Base path of the chronology page the era chip links to. */
44
+ eraBasePath?: string;
39
45
  }
40
46
 
41
47
  const {
@@ -52,7 +58,10 @@ const {
52
58
  placeholderClass = 'bg-gradient-to-br from-primary/20 to-accent/20',
53
59
  updatedIconClass = 'text-primary',
54
60
  bylineWhitespace = 'flat',
61
+ era,
62
+ eraBasePath,
55
63
  } = Astro.props;
64
+ const { era: _era, eraBasePath: _eraBasePath, ...bylineProps } = Astro.props;
56
65
 
57
66
  function formatDate(dateStr: string | undefined): string {
58
67
  if (!dateStr) return '';
@@ -86,6 +95,12 @@ const grouped = bylineWhitespace === 'grouped';
86
95
  const bylineLead = author ? (grouped ? ' ' : ' ') : (grouped ? '' : ' ');
87
96
  ---
88
97
 
98
+ {era ? (
99
+ <div class="flex flex-wrap items-start justify-between gap-x-6">
100
+ <div class="min-w-0 basis-full sm:basis-0 sm:flex-1"><Astro.self {...bylineProps} /></div>
101
+ <EraChip era={era} basePath={eraBasePath} class="mb-5 self-start" />
102
+ </div>
103
+ ) : (
89
104
  <address class="not-italic mb-5" role="group" aria-label={ariaLabel}>
90
105
  <div class="flex items-start gap-3">
91
106
  {author && (author.image ? (
@@ -144,3 +159,4 @@ const bylineLead = author ? (grouped ? ' ' : ' ') : (grouped ? '' : ' ');
144
159
  </div>
145
160
  </div>
146
161
  </address>
162
+ )}