feat(blog): add blog pageBasePath plugin option (#9838)

Co-authored-by: sebastien <lorber.sebastien@gmail.com>
This commit is contained in:
Liviu Ionescu 2024-02-13 14:27:23 +02:00 committed by GitHub
parent cc7f43580c
commit 70ba9d2d01
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 113 additions and 21 deletions

View file

@ -107,6 +107,7 @@ export default async function pluginContentBlog(
blogDescription,
blogTitle,
blogSidebarTitle,
pageBasePath,
} = options;
const baseBlogUrl = normalizeUrl([baseUrl, routeBasePath]);
@ -121,11 +122,10 @@ export default async function pluginContentBlog(
blogListPaginated: [],
blogTags: {},
blogTagsListPath,
blogTagsPaginated: [],
};
}
// Colocate next and prev metadata.
// Collocate next and prev metadata.
listedBlogPosts.forEach((blogPost, index) => {
const prevItem = index > 0 ? listedBlogPosts[index - 1] : null;
if (prevItem) {
@ -153,6 +153,7 @@ export default async function pluginContentBlog(
blogDescription,
postsPerPageOption,
basePageUrl: baseBlogUrl,
pageBasePath,
});
const blogTags: BlogTags = getBlogTags({
@ -160,6 +161,7 @@ export default async function pluginContentBlog(
postsPerPageOption,
blogDescription,
blogTitle,
pageBasePath,
});
return {