wpheadless-lib 1.1.5 → 1.1.6
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/dist/components/PostCard/index.d.ts +2 -1
- package/dist/components/PostCard/index.js +3 -2
- package/dist/components/PostCard/index.types.d.ts +1 -0
- package/dist/components/PostCard/index.utils.d.ts +2 -2
- package/dist/components/PostCard/index.utils.js +13 -3
- package/dist/views/CategoryListView/index.d.ts +2 -1
- package/dist/views/CategoryListView/index.js +2 -2
- package/dist/views/CategoryPaginationView/index.d.ts +2 -1
- package/dist/views/CategoryPaginationView/index.js +2 -2
- package/dist/views/HomePaginationView/index.d.ts +2 -1
- package/dist/views/HomePaginationView/index.js +2 -2
- package/dist/views/HomeView/index.d.ts +2 -1
- package/dist/views/HomeView/index.js +3 -3
- package/dist/views/HomeView/index.utils.d.ts +1 -1
- package/dist/views/HomeView/index.utils.js +3 -2
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ interface PostCardProps {
|
|
|
5
5
|
categorySlug?: string;
|
|
6
6
|
locale?: Locale;
|
|
7
7
|
dateLocale?: string;
|
|
8
|
+
basePath?: string;
|
|
8
9
|
}
|
|
9
|
-
export default function PostCard({ post, categorySlug, locale, dateLocale, }: PostCardProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default function PostCard({ post, categorySlug, locale, dateLocale, basePath, }: PostCardProps): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -8,7 +8,7 @@ function truncateText(text, max = 20) {
|
|
|
8
8
|
const normalized = text.trim();
|
|
9
9
|
return normalized.length > max ? `${normalized.slice(0, max)}...` : normalized;
|
|
10
10
|
}
|
|
11
|
-
export default function PostCard({ post, categorySlug, locale = "en", dateLocale = "en-US", }) {
|
|
11
|
+
export default function PostCard({ post, categorySlug, locale = "en", dateLocale = "en-US", basePath, }) {
|
|
12
12
|
const featuredMedia = getFeaturedMedia(post);
|
|
13
13
|
const imageUrl = featuredMedia?.source_url;
|
|
14
14
|
const categories = (post._embedded?.["wp:term"]?.[0] || []).filter((cat) => Boolean(cat?.slug));
|
|
@@ -17,8 +17,9 @@ export default function PostCard({ post, categorySlug, locale = "en", dateLocale
|
|
|
17
17
|
post,
|
|
18
18
|
categorySlug: resolvedCategory,
|
|
19
19
|
locale,
|
|
20
|
+
basePath,
|
|
20
21
|
});
|
|
21
|
-
return (_jsxs("article", { className: `${styles.card} card`, children: [categories.length > 0 && (_jsx("div", { className: styles.badges, children: categories.map((cat) => (_jsx(Link, { href: buildCategoryUrl(cat.slug, locale), className: `badge ${styles.badge}`, title: cat.name, children: truncateText(cat.name, 20) }, cat.id ?? cat.slug))) })), _jsxs(Link, { href: postUrl, className: styles.postLink, children: [imageUrl && (_jsx("div", { className: styles.imageWrapper, children: _jsx(Image, { src: imageUrl, alt: featuredMedia?.alt_text || post.title.rendered, fill: true, style: { objectFit: "cover" }, sizes: "(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw" }) })), _jsxs("div", { className: styles.body, children: [_jsx("h2", { className: styles.title, dangerouslySetInnerHTML: {
|
|
22
|
+
return (_jsxs("article", { className: `${styles.card} card`, children: [categories.length > 0 && (_jsx("div", { className: styles.badges, children: categories.map((cat) => (_jsx(Link, { href: buildCategoryUrl(cat.slug, locale, basePath), className: `badge ${styles.badge}`, title: cat.name, children: truncateText(cat.name, 20) }, cat.id ?? cat.slug))) })), _jsxs(Link, { href: postUrl, className: styles.postLink, children: [imageUrl && (_jsx("div", { className: styles.imageWrapper, children: _jsx(Image, { src: imageUrl, alt: featuredMedia?.alt_text || post.title.rendered, fill: true, style: { objectFit: "cover" }, sizes: "(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw" }) })), _jsxs("div", { className: styles.body, children: [_jsx("h2", { className: styles.title, dangerouslySetInnerHTML: {
|
|
22
23
|
__html: post.title.rendered,
|
|
23
24
|
} }), _jsx("div", { dangerouslySetInnerHTML: {
|
|
24
25
|
__html: post.excerpt.rendered,
|
|
@@ -3,6 +3,6 @@ import { type Locale } from "../../utils";
|
|
|
3
3
|
import type { BuildUrlArgs } from "./index.types";
|
|
4
4
|
export declare const getLangPrefix: (locale?: Locale) => string;
|
|
5
5
|
export declare const resolveCategorySlug: (post: WPPost, categorySlug?: string) => string | undefined;
|
|
6
|
-
export declare const buildPostUrl: ({ post, categorySlug, locale }: BuildUrlArgs) => string;
|
|
7
|
-
export declare const buildCategoryUrl: (slug: string, locale?: Locale) => string;
|
|
6
|
+
export declare const buildPostUrl: ({ post, categorySlug, locale, basePath, }: BuildUrlArgs) => string;
|
|
7
|
+
export declare const buildCategoryUrl: (slug: string, locale?: Locale, basePath?: string) => string;
|
|
8
8
|
export declare const formatPostDate: (date: string, dateLocale?: string) => string;
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import { ensureTrailingSlash } from "../../utils";
|
|
2
2
|
export const getLangPrefix = (locale) => locale && locale !== "en" ? `/${locale}` : "";
|
|
3
|
+
const normalizeBasePath = (basePath) => {
|
|
4
|
+
if (!basePath)
|
|
5
|
+
return "";
|
|
6
|
+
const withLeadingSlash = basePath.startsWith("/")
|
|
7
|
+
? basePath
|
|
8
|
+
: `/${basePath}`;
|
|
9
|
+
const trimmed = withLeadingSlash.replace(/\/+$/, "");
|
|
10
|
+
return trimmed === "/" ? "" : trimmed;
|
|
11
|
+
};
|
|
12
|
+
const resolveLinkPrefix = (basePath, locale) => basePath !== undefined ? normalizeBasePath(basePath) : getLangPrefix(locale);
|
|
3
13
|
export const resolveCategorySlug = (post, categorySlug) => {
|
|
4
14
|
if (categorySlug)
|
|
5
15
|
return categorySlug;
|
|
6
16
|
const categories = (post._embedded?.["wp:term"]?.[0] || []);
|
|
7
17
|
return categories[0]?.slug;
|
|
8
18
|
};
|
|
9
|
-
export const buildPostUrl = ({ post, categorySlug, locale }) => {
|
|
10
|
-
const langPrefix =
|
|
19
|
+
export const buildPostUrl = ({ post, categorySlug, locale, basePath, }) => {
|
|
20
|
+
const langPrefix = resolveLinkPrefix(basePath, locale);
|
|
11
21
|
const resolvedCategory = categorySlug || resolveCategorySlug(post);
|
|
12
22
|
const postPath = resolvedCategory
|
|
13
23
|
? `/${resolvedCategory}/${post.slug}`
|
|
@@ -15,7 +25,7 @@ export const buildPostUrl = ({ post, categorySlug, locale }) => {
|
|
|
15
25
|
const url = `${langPrefix}${postPath}`.replace(/\/+/g, "/");
|
|
16
26
|
return ensureTrailingSlash(url);
|
|
17
27
|
};
|
|
18
|
-
export const buildCategoryUrl = (slug, locale) => ensureTrailingSlash(`${
|
|
28
|
+
export const buildCategoryUrl = (slug, locale, basePath) => ensureTrailingSlash(`${resolveLinkPrefix(basePath, locale)}/${slug}`.replace(/\/+/g, "/"));
|
|
19
29
|
export const formatPostDate = (date, dateLocale) => new Date(date).toLocaleDateString(dateLocale || "en-US", {
|
|
20
30
|
year: "numeric",
|
|
21
31
|
month: "long",
|
|
@@ -6,8 +6,9 @@ type CategoryListViewProps = {
|
|
|
6
6
|
totalPages: number;
|
|
7
7
|
baseUrl?: string;
|
|
8
8
|
homeHref?: string;
|
|
9
|
+
linkBasePath?: string;
|
|
9
10
|
locale?: Locale;
|
|
10
11
|
dateLocale?: string;
|
|
11
12
|
};
|
|
12
|
-
export declare function CategoryListView({ category, posts, totalPages, baseUrl, homeHref, locale, dateLocale, }: CategoryListViewProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function CategoryListView({ category, posts, totalPages, baseUrl, homeHref, linkBasePath, locale, dateLocale, }: CategoryListViewProps): import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export {};
|
|
@@ -5,7 +5,7 @@ import styles from "./index.module.css";
|
|
|
5
5
|
import { getCountLabel, getEmptyLabel, getPaginatorBase } from "./index.utils";
|
|
6
6
|
import { Breadcrumbs } from "../../components";
|
|
7
7
|
import { getTranslator } from "../../utils";
|
|
8
|
-
export function CategoryListView({ category, posts, totalPages, baseUrl, homeHref = "/", locale, dateLocale = "en-US", }) {
|
|
8
|
+
export function CategoryListView({ category, posts, totalPages, baseUrl, homeHref = "/", linkBasePath, locale, dateLocale = "en-US", }) {
|
|
9
9
|
const paginatorBase = getPaginatorBase(category, baseUrl);
|
|
10
10
|
const countLabel = getCountLabel(category, locale);
|
|
11
11
|
const emptyLabel = getEmptyLabel(locale);
|
|
@@ -13,5 +13,5 @@ export function CategoryListView({ category, posts, totalPages, baseUrl, homeHre
|
|
|
13
13
|
return (_jsxs("div", { className: `container ${styles.container}`, children: [_jsxs("header", { className: styles.header, children: [_jsx(Breadcrumbs, { items: [
|
|
14
14
|
{ label: "Home", href: homeHref },
|
|
15
15
|
{ label: category.name },
|
|
16
|
-
] }), _jsx("h1", { className: styles.title, children: category.name }), category.description && (_jsx("div", { className: styles.description, dangerouslySetInnerHTML: { __html: category.description } })), countLabel && _jsx("p", { className: styles.count, children: countLabel })] }), posts.length === 0 ? (_jsx("p", { className: styles.empty, children: emptyLabel })) : (_jsxs("section", { "aria-label": t("home.title"), className: styles.gridSection, children: [_jsx("div", { className: styles.grid, children: posts.map((post) => (_jsx(PostCard, { post: post, categorySlug: category.slug, locale: locale, dateLocale: dateLocale }, post.id))) }), _jsx(Paginator, { currentPage: 1, totalPages: totalPages, baseUrl: paginatorBase, locale: locale })] }))] }));
|
|
16
|
+
] }), _jsx("h1", { className: styles.title, children: category.name }), category.description && (_jsx("div", { className: styles.description, dangerouslySetInnerHTML: { __html: category.description } })), countLabel && _jsx("p", { className: styles.count, children: countLabel })] }), posts.length === 0 ? (_jsx("p", { className: styles.empty, children: emptyLabel })) : (_jsxs("section", { "aria-label": t("home.title"), className: styles.gridSection, children: [_jsx("div", { className: styles.grid, children: posts.map((post) => (_jsx(PostCard, { post: post, categorySlug: category.slug, basePath: linkBasePath, locale: locale, dateLocale: dateLocale }, post.id))) }), _jsx(Paginator, { currentPage: 1, totalPages: totalPages, baseUrl: paginatorBase, locale: locale })] }))] }));
|
|
17
17
|
}
|
|
@@ -6,8 +6,9 @@ type CategoryPaginationViewProps = {
|
|
|
6
6
|
currentPage: number;
|
|
7
7
|
totalPages: number;
|
|
8
8
|
baseUrl?: string;
|
|
9
|
+
linkBasePath?: string;
|
|
9
10
|
locale?: Locale;
|
|
10
11
|
dateLocale?: string;
|
|
11
12
|
};
|
|
12
|
-
export declare function CategoryPaginationView({ category, posts, currentPage, totalPages, baseUrl, locale, dateLocale, }: CategoryPaginationViewProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function CategoryPaginationView({ category, posts, currentPage, totalPages, baseUrl, linkBasePath, locale, dateLocale, }: CategoryPaginationViewProps): import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export {};
|
|
@@ -5,7 +5,7 @@ import styles from "./index.module.css";
|
|
|
5
5
|
import { getEmptyLabel, getPageLabel, getPaginatorBase } from "./index.utils";
|
|
6
6
|
import { Breadcrumbs } from "../../components";
|
|
7
7
|
import { getTranslator } from "../../utils";
|
|
8
|
-
export function CategoryPaginationView({ category, posts, currentPage, totalPages, baseUrl, locale, dateLocale = "en-US", }) {
|
|
8
|
+
export function CategoryPaginationView({ category, posts, currentPage, totalPages, baseUrl, linkBasePath, locale, dateLocale = "en-US", }) {
|
|
9
9
|
const paginatorBase = getPaginatorBase(category, baseUrl);
|
|
10
10
|
const pageLabel = getPageLabel(locale, currentPage);
|
|
11
11
|
const emptyLabel = getEmptyLabel(locale);
|
|
@@ -14,5 +14,5 @@ export function CategoryPaginationView({ category, posts, currentPage, totalPage
|
|
|
14
14
|
{ label: "Home", href: paginatorBase || "/" },
|
|
15
15
|
{ label: category.name },
|
|
16
16
|
{ label: pageLabel },
|
|
17
|
-
] }), _jsx("h1", { className: styles.title, children: category.name }), _jsx("p", { className: styles.pageLabel, children: pageLabel })] }), posts.length === 0 ? (_jsx("p", { className: styles.empty, children: emptyLabel })) : (_jsxs("section", { "aria-label": t("category.pageLabel", { page: currentPage }), className: styles.gridSection, children: [_jsx("div", { className: styles.grid, children: posts.map((post) => (_jsx(PostCard, { post: post, categorySlug: category.slug, locale: locale, dateLocale: dateLocale }, post.id))) }), _jsx(Paginator, { currentPage: currentPage, totalPages: totalPages, baseUrl: paginatorBase, locale: locale })] }))] }));
|
|
17
|
+
] }), _jsx("h1", { className: styles.title, children: category.name }), _jsx("p", { className: styles.pageLabel, children: pageLabel })] }), posts.length === 0 ? (_jsx("p", { className: styles.empty, children: emptyLabel })) : (_jsxs("section", { "aria-label": t("category.pageLabel", { page: currentPage }), className: styles.gridSection, children: [_jsx("div", { className: styles.grid, children: posts.map((post) => (_jsx(PostCard, { post: post, categorySlug: category.slug, basePath: linkBasePath, locale: locale, dateLocale: dateLocale }, post.id))) }), _jsx(Paginator, { currentPage: currentPage, totalPages: totalPages, baseUrl: paginatorBase, locale: locale })] }))] }));
|
|
18
18
|
}
|
|
@@ -6,8 +6,9 @@ type HomePaginationViewProps = {
|
|
|
6
6
|
totalPages: number;
|
|
7
7
|
error?: string | null;
|
|
8
8
|
baseUrl?: string;
|
|
9
|
+
linkBasePath?: string;
|
|
9
10
|
locale?: Locale;
|
|
10
11
|
dateLocale?: string;
|
|
11
12
|
};
|
|
12
|
-
export declare function HomePaginationView({ posts, currentPage, totalPages, error, baseUrl, locale, dateLocale, }: HomePaginationViewProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function HomePaginationView({ posts, currentPage, totalPages, error, baseUrl, linkBasePath, locale, dateLocale, }: HomePaginationViewProps): import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export {};
|
|
@@ -3,7 +3,7 @@ import Paginator from "../../components/Paginator";
|
|
|
3
3
|
import PostCard from "../../components/PostCard";
|
|
4
4
|
import styles from "./index.module.css";
|
|
5
5
|
import { buildHomePaginationCopy } from "./index.utils";
|
|
6
|
-
export function HomePaginationView({ posts, currentPage, totalPages, error, baseUrl = "", locale, dateLocale = "en-US", }) {
|
|
6
|
+
export function HomePaginationView({ posts, currentPage, totalPages, error, baseUrl = "", linkBasePath, locale, dateLocale = "en-US", }) {
|
|
7
7
|
const copy = buildHomePaginationCopy(locale, currentPage, error);
|
|
8
|
-
return (_jsxs("div", { className: `container ${styles.container}`, children: [_jsxs("header", { className: styles.header, children: [_jsx("h1", { className: styles.title, children: copy.title }), _jsx("p", { className: styles.subtitle, children: copy.subtitle })] }), error ? (_jsx("div", { className: `card ${styles.errorCard}`, children: copy.errorText && _jsx("p", { children: copy.errorText }) })) : posts.length === 0 ? (_jsx("p", { className: styles.empty, children: copy.empty })) : (_jsxs("section", { "aria-label": copy.title, className: styles.gridSection, role: "region", children: [_jsx("div", { className: styles.grid, children: posts.map((post) => (_jsx(PostCard, { post: post, locale: locale, dateLocale: dateLocale }, post.id))) }), _jsx(Paginator, { currentPage: currentPage, totalPages: totalPages, baseUrl: baseUrl, locale: locale })] }))] }));
|
|
8
|
+
return (_jsxs("div", { className: `container ${styles.container}`, children: [_jsxs("header", { className: styles.header, children: [_jsx("h1", { className: styles.title, children: copy.title }), _jsx("p", { className: styles.subtitle, children: copy.subtitle })] }), error ? (_jsx("div", { className: `card ${styles.errorCard}`, children: copy.errorText && _jsx("p", { children: copy.errorText }) })) : posts.length === 0 ? (_jsx("p", { className: styles.empty, children: copy.empty })) : (_jsxs("section", { "aria-label": copy.title, className: styles.gridSection, role: "region", children: [_jsx("div", { className: styles.grid, children: posts.map((post) => (_jsx(PostCard, { post: post, basePath: linkBasePath, locale: locale, dateLocale: dateLocale }, post.id))) }), _jsx(Paginator, { currentPage: currentPage, totalPages: totalPages, baseUrl: baseUrl, locale: locale })] }))] }));
|
|
9
9
|
}
|
|
@@ -6,8 +6,9 @@ type HomeViewProps = {
|
|
|
6
6
|
error?: string | null;
|
|
7
7
|
totalPages: number;
|
|
8
8
|
baseUrl?: string;
|
|
9
|
+
linkBasePath?: string;
|
|
9
10
|
locale?: Locale;
|
|
10
11
|
dateLocale?: string;
|
|
11
12
|
};
|
|
12
|
-
export declare function HomeView({ featuredPost, regularPosts, error, totalPages, baseUrl, locale, dateLocale, }: HomeViewProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function HomeView({ featuredPost, regularPosts, error, totalPages, baseUrl, linkBasePath, locale, dateLocale, }: HomeViewProps): import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export {};
|
|
@@ -9,10 +9,10 @@ function truncateLabel(label, max = 20) {
|
|
|
9
9
|
const trimmed = label.trim();
|
|
10
10
|
return trimmed.length > max ? `${trimmed.slice(0, max)}...` : trimmed;
|
|
11
11
|
}
|
|
12
|
-
export function HomeView({ featuredPost, regularPosts, error, totalPages, baseUrl = "", locale, dateLocale = "en-US", }) {
|
|
12
|
+
export function HomeView({ featuredPost, regularPosts, error, totalPages, baseUrl = "", linkBasePath, locale, dateLocale = "en-US", }) {
|
|
13
13
|
const copy = getHomeCopy(locale);
|
|
14
14
|
const featuredModel = featuredPost
|
|
15
|
-
? buildFeaturedViewModel(featuredPost, locale, dateLocale)
|
|
15
|
+
? buildFeaturedViewModel(featuredPost, locale, dateLocale, linkBasePath)
|
|
16
16
|
: null;
|
|
17
17
|
return (_jsx("div", { className: `container ${styles.container}`, children: error ? (_jsxs("div", { className: styles.errorBox, children: [_jsxs("p", { children: [copy.errorTitle, ": ", error] }), _jsx("p", { className: styles.errorHint, children: copy.errorHint })] })) : !featuredModel && regularPosts.length === 0 ? (_jsx("p", { className: styles.empty, children: copy.empty })) : (_jsxs(_Fragment, { children: [featuredModel && (_jsxs("article", { className: `card ${styles.featured} ${featuredModel.image
|
|
18
18
|
? styles.featuredWithImage
|
|
@@ -21,5 +21,5 @@ export function HomeView({ featuredPost, regularPosts, error, totalPages, baseUr
|
|
|
21
21
|
__html: featuredModel.titleHtml,
|
|
22
22
|
}, className: styles.featuredTitle }) }), _jsx("div", { dangerouslySetInnerHTML: {
|
|
23
23
|
__html: featuredModel.excerptHtml,
|
|
24
|
-
}, className: `text-muted ${styles.featuredExcerpt}` }), _jsx("time", { dateTime: featuredModel.dateTime, className: `text-muted ${styles.featuredDate}`, children: featuredModel.dateLabel })] })] })), _jsx("section", { className: styles.postsGrid, "aria-label": copy.title, role: "region", children: regularPosts.map((post) => (_jsx(PostCard, { post: post, locale: locale, dateLocale: dateLocale }, post.id))) }), _jsx(Paginator, { currentPage: 1, totalPages: totalPages, baseUrl: baseUrl, locale: locale })] })) }));
|
|
24
|
+
}, className: `text-muted ${styles.featuredExcerpt}` }), _jsx("time", { dateTime: featuredModel.dateTime, className: `text-muted ${styles.featuredDate}`, children: featuredModel.dateLabel })] })] })), _jsx("section", { className: styles.postsGrid, "aria-label": copy.title, role: "region", children: regularPosts.map((post) => (_jsx(PostCard, { post: post, basePath: linkBasePath, locale: locale, dateLocale: dateLocale }, post.id))) }), _jsx(Paginator, { currentPage: 1, totalPages: totalPages, baseUrl: baseUrl, locale: locale })] })) }));
|
|
25
25
|
}
|
|
@@ -20,4 +20,4 @@ export type FeaturedViewModel = {
|
|
|
20
20
|
alt: string;
|
|
21
21
|
} | undefined;
|
|
22
22
|
};
|
|
23
|
-
export declare const buildFeaturedViewModel: (post: WPPost, locale?: Locale, dateLocale?: string) => FeaturedViewModel;
|
|
23
|
+
export declare const buildFeaturedViewModel: (post: WPPost, locale?: Locale, dateLocale?: string, basePath?: string) => FeaturedViewModel;
|
|
@@ -9,7 +9,7 @@ export const getHomeCopy = (locale) => {
|
|
|
9
9
|
errorHint: t("home.errorHint"),
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
|
-
export const buildFeaturedViewModel = (post, locale, dateLocale = "en-US") => {
|
|
12
|
+
export const buildFeaturedViewModel = (post, locale, dateLocale = "en-US", basePath) => {
|
|
13
13
|
const t = getTranslator(locale);
|
|
14
14
|
const featuredMedia = getFeaturedMedia(post);
|
|
15
15
|
const imageUrl = featuredMedia?.source_url;
|
|
@@ -19,9 +19,10 @@ export const buildFeaturedViewModel = (post, locale, dateLocale = "en-US") => {
|
|
|
19
19
|
post,
|
|
20
20
|
categorySlug: primaryCategory?.slug,
|
|
21
21
|
locale,
|
|
22
|
+
basePath,
|
|
22
23
|
});
|
|
23
24
|
const badgeUrl = primaryCategory
|
|
24
|
-
? buildCategoryUrl(primaryCategory.slug, locale)
|
|
25
|
+
? buildCategoryUrl(primaryCategory.slug, locale, basePath)
|
|
25
26
|
: null;
|
|
26
27
|
return {
|
|
27
28
|
postUrl,
|