@sarimarcus/content-sites-ui 0.59.0 → 0.60.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,18 @@
2
2
 
3
3
  All packages in the platform release in lockstep; entries are per release version.
4
4
 
5
+ ## 0.60.1 (2026-11-06)
6
+
7
+ Completes 0.60.0's nested article URLs: the topic nav inside the hub and tag pages now follows the site's routes. Without `routes` the markup is unchanged: `render-diff` against 0.60.0 is identical (`tests/fixtures/render-diff/article-nav-routes-default.json`).
8
+
9
+ - `ArticleTopicPage`, `ArticleTagPage`: new optional `routes` prop, passed to their `ArticleCategoryNav`, so a site with `routes.articleTopic` links its topic nav to its own hubs.
10
+
11
+ ## 0.60.0 (2026-11-06)
12
+
13
+ Article cards and the editorial home lead link through core `articlePath`, so a site's `routes.articleItem` reaches them. Without that route the hrefs are unchanged: `render-diff` against 0.59.0 is identical for both with default routes (`tests/fixtures/render-diff/article-path-default.json`).
14
+
15
+ - `ArticleCardGrid`, `EditorialHomePage`: the article href is `articlePath(slug, category, routes)` instead of `routePath('articles', slug, routes)`.
16
+
5
17
  ## 0.59.0 (2026-11-06)
6
18
 
7
19
  Opt-in slimmer author block for the editorial article head. Defaults keep today's markup: `render-diff` against 0.58.0 is byte-identical for `ArticleMetadata`, `ShareButtons` (default and `compact`) and `ArticlePage` with the standard head (`tests/fixtures/render-diff/editorial-byline.json`).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sarimarcus/content-sites-ui",
3
- "version": "0.59.0",
3
+ "version": "0.60.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",
@@ -51,6 +51,6 @@
51
51
  "@lucide/astro": "^1.23.0",
52
52
  "astro": "^7.0.6",
53
53
  "tailwindcss": "^4.1.18",
54
- "@sarimarcus/content-sites-core": "0.59.0"
54
+ "@sarimarcus/content-sites-core": "0.60.1"
55
55
  }
56
56
  }
@@ -9,7 +9,7 @@ import type { ImageMetadata } from 'astro';
9
9
  import { isUpdatedAfterPublication } from '@sarimarcus/content-sites-core/articles';
10
10
  import { formatDisplayDay } from '@sarimarcus/content-sites-core/dates';
11
11
  import { readingTime } from '@sarimarcus/content-sites-core/text';
12
- import { routePath, url as defaultUrl, type SiteRoutes } from '@sarimarcus/content-sites-core/url';
12
+ import { articlePath, url as defaultUrl, type SiteRoutes } from '@sarimarcus/content-sites-core/url';
13
13
  import { getLabels } from '../internal/labels';
14
14
  import ArticleGrid from './ArticleGrid.astro';
15
15
 
@@ -44,7 +44,7 @@ interface Props {
44
44
  locale?: string;
45
45
  readLabel?: string;
46
46
  updatedLabel?: string;
47
- /** Overrides of the `articles` route. */
47
+ /** Overrides of the article routes (`articleItem`). */
48
48
  routes?: SiteRoutes;
49
49
  /** Grid column count when `class` is not supplied (defaults to 3). */
50
50
  columns?: 2 | 3;
@@ -86,7 +86,7 @@ const items = articles.map(({ data: a }) => {
86
86
  ? `${readingTime(a)} ${minutesSuffix}`
87
87
  : undefined;
88
88
  return {
89
- href: resolveUrl(routePath('articles', a.slug, routes)),
89
+ href: resolveUrl(articlePath(a.slug, a.category, routes)),
90
90
  title: a.title,
91
91
  description: a.description,
92
92
  author: a.author,
@@ -11,6 +11,7 @@ import Chip from '../primitives/Chip.astro';
11
11
  import { getLabels } from '../internal/labels';
12
12
  import ArticlesListingPage from './ArticlesListingPage.astro';
13
13
  import ArticleCategoryNav from './ArticleCategoryNav.astro';
14
+ import type { SiteRoutes } from '@sarimarcus/content-sites-core/url';
14
15
  import type { ArticleCategoryMeta } from './types';
15
16
 
16
17
  export interface ArticleTagPill {
@@ -34,6 +35,8 @@ interface Props {
34
35
  relatedTagsLimit?: number;
35
36
  showRelatedTags?: boolean;
36
37
  locale?: string;
38
+ /** Overrides of the article routes (`articles`, `articleTopic`), for the topic nav. */
39
+ routes?: SiteRoutes;
37
40
  }
38
41
 
39
42
  const {
@@ -48,6 +51,7 @@ const {
48
51
  relatedTagsLimit,
49
52
  showRelatedTags = true,
50
53
  locale,
54
+ routes,
51
55
  } = Astro.props;
52
56
  const l = getLabels(locale).articleTagPage;
53
57
  const resolvedEyebrow = eyebrow === false ? undefined : (eyebrow ?? l.eyebrow);
@@ -63,7 +67,7 @@ const countWord = count === 1 ? l.countOne : l.countMany;
63
67
 
64
68
  <Container>
65
69
  {categories && articles.length > 0 && (
66
- <ArticleCategoryNav articles={articles} categories={categories} class="mb-8" />
70
+ <ArticleCategoryNav articles={articles} categories={categories} routes={routes} class="mb-8" />
67
71
  )}
68
72
 
69
73
  {showRelatedTags && relatedTags.length > 1 && (
@@ -19,6 +19,7 @@ import Callout from '../primitives/Callout.astro';
19
19
  import type { TrustedHtml } from '../types';
20
20
  import ArticlesListingPage from './ArticlesListingPage.astro';
21
21
  import ArticleCategoryNav from './ArticleCategoryNav.astro';
22
+ import type { SiteRoutes } from '@sarimarcus/content-sites-core/url';
22
23
  import type { ArticleCategoryMeta, TopicAuthorCard } from './types';
23
24
 
24
25
  interface Props {
@@ -37,9 +38,11 @@ interface Props {
37
38
  authors?: { heading: string; items: TopicAuthorCard[] };
38
39
  /** The site's prose theme modifier for the overview, added to `prose` (a dark site needs its own body colour). */
39
40
  proseClass?: string;
41
+ /** Overrides of the article routes (`articles`, `articleTopic`), for the topic nav. */
42
+ routes?: SiteRoutes;
40
43
  }
41
44
 
42
- const { eyebrow, heading, lede, articles, categories, category, currentPage, listHeading, overview, authors, proseClass = 'prose-lg' } = Astro.props;
45
+ const { eyebrow, heading, lede, articles, categories, category, currentPage, listHeading, overview, authors, proseClass = 'prose-lg', routes } = Astro.props;
43
46
  const hub = currentPage === 1;
44
47
  // Astro.slots.has() is true for a slotted expression that evaluated to false, so test what it rendered.
45
48
  const faqHtml = hub && Astro.slots.has('faq') ? (await Astro.slots.render('faq')).trim() : '';
@@ -50,7 +53,7 @@ const faqHtml = hub && Astro.slots.has('faq') ? (await Astro.slots.render('faq')
50
53
  <slot name="breadcrumb" slot="breadcrumb" />
51
54
  <slot name="header-extra" slot="header-extra" />
52
55
  <Container>
53
- <ArticleCategoryNav articles={articles} categories={categories} current={category} class="mb-12" />
56
+ <ArticleCategoryNav articles={articles} categories={categories} current={category} routes={routes} class="mb-12" />
54
57
  <slot name="start-here" /></Container>
55
58
 
56
59
  {overview && (
@@ -103,7 +106,7 @@ const faqHtml = hub && Astro.slots.has('faq') ? (await Astro.slots.render('faq')
103
106
  <ArticlesListingPage eyebrow={eyebrow} heading={heading} lede={lede}>
104
107
  <slot name="breadcrumb" slot="breadcrumb" />
105
108
  <Container>
106
- <ArticleCategoryNav articles={articles} categories={categories} current={category} class="mb-10" />
109
+ <ArticleCategoryNav articles={articles} categories={categories} current={category} routes={routes} class="mb-10" />
107
110
  <slot name="grid" />
108
111
  <slot name="pagination" />
109
112
  </Container>
@@ -20,7 +20,7 @@ import {
20
20
  type FeaturedSnapshot,
21
21
  } from '@sarimarcus/content-sites-core/articles';
22
22
  import { readingTime } from '@sarimarcus/content-sites-core/text';
23
- import { routePath, type SiteRoutes } from '@sarimarcus/content-sites-core/url';
23
+ import { articlePath, routePath, type SiteRoutes } from '@sarimarcus/content-sites-core/url';
24
24
  import Container from '../layout/Container.astro';
25
25
  import { getLabels } from '../internal/labels';
26
26
  import ArticleCardGrid, { type ArticleCardGridEntry } from './ArticleCardGrid.astro';
@@ -142,7 +142,7 @@ const leadReadMins = lead?.data.sections ? readingTime({ sections: lead.data.sec
142
142
  <Container>
143
143
  <section aria-label={l.featuredEyebrow} class="mb-14">
144
144
  <ArticleFeatureCard
145
- href={url(routePath('articles', lead.data.slug, routes))}
145
+ href={url(articlePath(lead.data.slug, lead.data.category, routes))}
146
146
  title={lead.data.title}
147
147
  description={lead.data.description}
148
148
  author={lead.data.author ?? brand}