@sarimarcus/content-sites-ui 0.31.6 → 0.32.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +10 -3
  3. package/package.json +2 -2
  4. package/src/affiliate/AffiliateCard.astro +7 -6
  5. package/src/affiliate/AffiliateCardSection.astro +2 -1
  6. package/src/affiliate/AffiliateCarousel.astro +4 -4
  7. package/src/affiliate/AffiliateComparisonTable.astro +11 -10
  8. package/src/affiliate/AmazonProductCard.astro +2 -1
  9. package/src/affiliate/AmazonProductSection.astro +2 -1
  10. package/src/affiliate/HotelAffiliateCTA.astro +12 -11
  11. package/src/affiliate/InlineAffiliateCTA.astro +2 -1
  12. package/src/affiliate/StickyCTA.astro +4 -3
  13. package/src/affiliate/TravelpayoutsWidget.astro +2 -6
  14. package/src/affiliate/provider.ts +3 -1
  15. package/src/composed/CardCarousel.astro +13 -5
  16. package/src/composed/EntityCard.astro +0 -2
  17. package/src/composed/FAQ.astro +2 -1
  18. package/src/composed/InlineImage.astro +0 -2
  19. package/src/composed/Pagination.astro +25 -8
  20. package/src/composed/TableOfContents.astro +10 -5
  21. package/src/editorial/AlsoExplore.astro +2 -1
  22. package/src/editorial/ArticleCategoryNav.astro +9 -5
  23. package/src/editorial/ArticleFeatureCard.astro +2 -1
  24. package/src/editorial/ArticleTopicPager.astro +7 -4
  25. package/src/editorial/NotFoundPage.astro +5 -2
  26. package/src/editorial/VisitTiming.astro +8 -4
  27. package/src/editorial/index.ts +1 -1
  28. package/src/editorial/types.ts +0 -4
  29. package/src/internal/labels.ts +102 -0
  30. package/src/layout/BreadcrumbBand.astro +4 -3
  31. package/src/layout/EntityDetailShell.astro +84 -0
  32. package/src/layout/ListingShell.astro +4 -2
  33. package/src/layout/analytics.ts +0 -2
  34. package/src/layout/index.ts +2 -1
  35. package/src/navigation/ArticlesNavMenu.astro +2 -1
  36. package/src/navigation/SiteFooter.astro +10 -4
  37. package/src/navigation/SiteHeader.astro +4 -3
  38. package/src/primitives/index.ts +1 -0
  39. package/src/seo/ArticleMetadata.astro +6 -5
  40. package/src/seo/AuthoritativeSources.astro +7 -6
  41. package/src/seo/Breadcrumb.astro +3 -2
  42. package/src/seo/author.ts +5 -3
package/src/seo/author.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { ImageMetadata } from 'astro';
2
- import { url } from '@sarimarcus/content-sites-core/url';
2
+ import { routePath, url, type SiteRoutes } from '@sarimarcus/content-sites-core/url';
3
3
  import type { ArticleAuthor } from './types';
4
4
 
5
5
  /** The fields of a site's author profile that a byline uses. */
@@ -11,18 +11,20 @@ export interface ArticleAuthorProfile {
11
11
 
12
12
  /**
13
13
  * A byline name as ArticleMetadata's author: its profile (from `findProfile`) URL, portrait (from `portrait(slug)`),
14
- * photo URL and credentials. An unknown name keeps only the name; no name gives no author.
14
+ * photo URL and credentials. An unknown name keeps only the name; no name gives no author. `routes` overrides the
15
+ * `author` route.
15
16
  */
16
17
  export function toArticleAuthor(
17
18
  name: string | undefined,
18
19
  findProfile: (name: string) => ArticleAuthorProfile | undefined,
19
20
  portrait: (slug: string) => ImageMetadata | null,
21
+ routes?: SiteRoutes,
20
22
  ): ArticleAuthor | undefined {
21
23
  if (!name) return undefined;
22
24
  const profile = findProfile(name);
23
25
  return {
24
26
  name,
25
- href: profile ? url(`/author/${profile.slug}`) : null,
27
+ href: profile ? url(routePath('author', profile.slug, routes)) : null,
26
28
  image: profile?.slug ? portrait(profile.slug) : null,
27
29
  photoUrl: profile?.photo ? url(profile.photo) : null,
28
30
  credentials: profile?.credentials ?? null,