@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.
- package/CHANGELOG.md +18 -0
- package/README.md +10 -3
- package/package.json +2 -2
- package/src/affiliate/AffiliateCard.astro +7 -6
- package/src/affiliate/AffiliateCardSection.astro +2 -1
- package/src/affiliate/AffiliateCarousel.astro +4 -4
- package/src/affiliate/AffiliateComparisonTable.astro +11 -10
- package/src/affiliate/AmazonProductCard.astro +2 -1
- package/src/affiliate/AmazonProductSection.astro +2 -1
- package/src/affiliate/HotelAffiliateCTA.astro +12 -11
- package/src/affiliate/InlineAffiliateCTA.astro +2 -1
- package/src/affiliate/StickyCTA.astro +4 -3
- package/src/affiliate/TravelpayoutsWidget.astro +2 -6
- package/src/affiliate/provider.ts +3 -1
- package/src/composed/CardCarousel.astro +13 -5
- package/src/composed/EntityCard.astro +0 -2
- package/src/composed/FAQ.astro +2 -1
- package/src/composed/InlineImage.astro +0 -2
- package/src/composed/Pagination.astro +25 -8
- package/src/composed/TableOfContents.astro +10 -5
- package/src/editorial/AlsoExplore.astro +2 -1
- package/src/editorial/ArticleCategoryNav.astro +9 -5
- package/src/editorial/ArticleFeatureCard.astro +2 -1
- package/src/editorial/ArticleTopicPager.astro +7 -4
- package/src/editorial/NotFoundPage.astro +5 -2
- package/src/editorial/VisitTiming.astro +8 -4
- package/src/editorial/index.ts +1 -1
- package/src/editorial/types.ts +0 -4
- package/src/internal/labels.ts +102 -0
- package/src/layout/BreadcrumbBand.astro +4 -3
- package/src/layout/EntityDetailShell.astro +84 -0
- package/src/layout/ListingShell.astro +4 -2
- package/src/layout/analytics.ts +0 -2
- package/src/layout/index.ts +2 -1
- package/src/navigation/ArticlesNavMenu.astro +2 -1
- package/src/navigation/SiteFooter.astro +10 -4
- package/src/navigation/SiteHeader.astro +4 -3
- package/src/primitives/index.ts +1 -0
- package/src/seo/ArticleMetadata.astro +6 -5
- package/src/seo/AuthoritativeSources.astro +7 -6
- package/src/seo/Breadcrumb.astro +3 -2
- 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(
|
|
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,
|