@sarimarcus/content-sites-ui 0.45.0 → 0.46.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,10 @@
2
2
 
3
3
  All packages in the platform release in lockstep; entries are per release version.
4
4
 
5
+ ## 0.46.0 (2026-10-22)
6
+
7
+ - `editorial`: new `EraListingPage`, an era's article listing (`/articles/era/<id>`) on the `ArticlesListingPage` shell: the era hero in a `<figure>`, a labelled list section with `grid` and `pagination` slots, a `go-deeper` slot and the era's dossier links on page 1; a page above 1 carries only the grid and pagination. `EraScenes` takes an optional `articleListings` (`{ [eraId]: { href, count } }`); when set, an era's articles strip ends with an "All N articles" link (`LABELS.eraScenes.allArticlesLabel`). Without it the markup is unchanged (SLA-3306).
8
+
5
9
  ## 0.45.0 (2026-10-22)
6
10
 
7
11
  - No changes; lockstep release with core (SLA-3297).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sarimarcus/content-sites-ui",
3
- "version": "0.45.0",
3
+ "version": "0.46.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.45.0"
53
+ "@sarimarcus/content-sites-core": "0.46.0"
54
54
  }
55
55
  }
@@ -0,0 +1,78 @@
1
+ ---
2
+ /**
3
+ * EraListingPage — an era's article listing (/articles/era/<id>) or one of its paginated pages, inside
4
+ * ArticlesListingPage. The route keeps paths, data, SEO, schema and the site Layout; every string arrives as a prop.
5
+ * Page 1 opens with the era's hero and ends with the era's dossier links; a page above 1 renders only the grid and
6
+ * pagination. Blocks the site renders through its own adapters (cards, pagination) arrive as slots.
7
+ * Slots:
8
+ * breadcrumb — the site Breadcrumb.
9
+ * header-extra — a line under the lede (e.g. the article count and the era's date range). Page 1 only.
10
+ * grid — the site's article card grid for this page.
11
+ * pagination — the site's pagination.
12
+ * go-deeper — related-content blocks after the list. Page 1 only.
13
+ */
14
+ import type { ImageMetadata } from 'astro';
15
+ import type { EraDefinition } from '@sarimarcus/content-sites-core/eras';
16
+ import Container from '../layout/Container.astro';
17
+ import ResponsivePicture from '../primitives/ResponsivePicture.astro';
18
+ import ArticlesListingPage from './ArticlesListingPage.astro';
19
+ import EraDossiers from './EraDossiers.astro';
20
+
21
+ interface Props {
22
+ eyebrow: string;
23
+ heading: string;
24
+ lede: string;
25
+ era: EraDefinition;
26
+ /** The era's hero image and its alt text for this listing; page 1 only. */
27
+ hero?: { image: ImageMetadata; alt: string };
28
+ /** Page 1 is the hub; a later page carries only the grid and pagination. */
29
+ currentPage: number;
30
+ /** Heading over the page-1 list. */
31
+ listHeading?: string;
32
+ /** Label over the era's dossier links. */
33
+ dossiersLabel?: string;
34
+ }
35
+
36
+ const { eyebrow, heading, lede, era, hero, currentPage, listHeading, dossiersLabel } = Astro.props;
37
+ const first = currentPage === 1;
38
+ const headingId = `${era.anchor}-articles-heading`;
39
+ ---
40
+
41
+ {first ? (
42
+ <ArticlesListingPage eyebrow={eyebrow} heading={heading} lede={lede} pagefindBody>
43
+ <slot name="breadcrumb" slot="breadcrumb" />
44
+ <slot name="header-extra" slot="header-extra" />
45
+ {hero && (
46
+ <Container class="mb-12">
47
+ <figure class="overflow-hidden rounded-xl">
48
+ <ResponsivePicture
49
+ src={hero.image}
50
+ alt={hero.alt}
51
+ sizes="(min-width: 1152px) 1152px, 100vw"
52
+ loading="eager"
53
+ fetchpriority="high"
54
+ decoding="async"
55
+ class="aspect-[16/7] w-full object-cover"
56
+ />
57
+ </figure>
58
+ </Container>
59
+ )}
60
+ <Container>
61
+ <section id="all-articles" aria-labelledby={listHeading ? headingId : undefined}>
62
+ {listHeading && <h2 id={headingId} class="text-2xl sm:text-3xl font-normal font-display text-foreground mb-6">{listHeading}</h2>}
63
+ <slot name="grid" />
64
+ <slot name="pagination" />
65
+ </section>
66
+ <slot name="go-deeper" />
67
+ <EraDossiers era={era} label={dossiersLabel} />
68
+ </Container>
69
+ </ArticlesListingPage>
70
+ ) : (
71
+ <ArticlesListingPage eyebrow={eyebrow} heading={heading} lede={lede}>
72
+ <slot name="breadcrumb" slot="breadcrumb" />
73
+ <Container>
74
+ <slot name="grid" />
75
+ <slot name="pagination" />
76
+ </Container>
77
+ </ArticlesListingPage>
78
+ )}
@@ -16,6 +16,7 @@ import TableOfContents from '../composed/TableOfContents.astro';
16
16
  import EntityCard from '../composed/EntityCard.astro';
17
17
  import Container from '../layout/Container.astro';
18
18
  import Icon from '../primitives/Icon.astro';
19
+ import LinkArrow from '../primitives/LinkArrow.astro';
19
20
  import ResponsivePicture from '../primitives/ResponsivePicture.astro';
20
21
  import PersonCard from './PersonCard.astro';
21
22
  import CardPlaceholder from './CardPlaceholder.astro';
@@ -38,11 +39,13 @@ interface Props {
38
39
  indexStyle?: 'chips' | 'timeline';
39
40
  castLimit?: number;
40
41
  articleLimit?: number;
42
+ /** Per era id, the full article count and the listing page; the era's articles strip links to it when set. */
43
+ articleListings?: Record<string, { href: string; count: number }>;
41
44
  labels?: Partial<SceneLabels>;
42
45
  class?: string;
43
46
  }
44
47
 
45
- const { eras, items, index = true, indexStyle = 'chips', castLimit = 6, articleLimit = 5, labels, class: className } = Astro.props;
48
+ const { eras, items, index = true, indexStyle = 'chips', castLimit = 6, articleLimit = 5, articleListings = {}, labels, class: className } = Astro.props;
46
49
  const L: SceneLabels = { ...LABELS.eraScenes, ...labels };
47
50
 
48
51
  const scenes = orderEras(eras).map((era) => ({ era, scene: splitScene(items[era.id] ?? [], { castLimit, articleLimit }) }));
@@ -203,7 +206,9 @@ const stripHeading = 'font-display text-2xl text-foreground';
203
206
  <h3 id={`${era.anchor}-articles`} class={stripHeading}>{L.articlesHeading}</h3>
204
207
  <ol aria-labelledby={`${era.anchor}-articles`} class="mt-4 divide-y divide-border border-y border-border">
205
208
  {scene.articles.map((item) => <EraEntryRow item={item} headingLevel={4} />)}
206
- </ol>
209
+ </ol>{articleListings[era.id] && (
210
+ <p class="mt-4"><LinkArrow href={articleListings[era.id].href} class="min-h-11">{L.allArticlesLabel(articleListings[era.id].count)}</LinkArrow></p>
211
+ )}
207
212
  </div>
208
213
  )}
209
214
 
@@ -18,6 +18,7 @@ export { default as ArticleGrid } from './ArticleGrid.astro';
18
18
  export { default as ArticleHubSection } from './ArticleHubSection.astro';
19
19
  export { default as ArticleCategoryNav } from './ArticleCategoryNav.astro';
20
20
  export { default as ArticleTopicPage } from './ArticleTopicPage.astro';
21
+ export { default as EraListingPage } from './EraListingPage.astro';
21
22
  export { default as ArticleTopicPager } from './ArticleTopicPager.astro';
22
23
  export { rankByCount } from './topic';
23
24
  export type { AuthorSummary, ArticleSummary, KeyFact, ArticleCategoryLink, ArticleCategoryMeta, TopicAuthorCard, TopicPagerLink } from './types';
@@ -139,6 +139,7 @@ export const LABELS = {
139
139
  peopleHeading: 'People',
140
140
  monumentsHeading: 'Monuments',
141
141
  articlesHeading: 'Articles',
142
+ allArticlesLabel: (count: number) => `All ${count} articles`,
142
143
  portraitAlt: (name: string) => `Portrait of ${name}`,
143
144
  },
144
145
  };