mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-25 15:07:17 +02:00
feat(blog): add blog pageBasePath plugin option (#9838)
Co-authored-by: sebastien <lorber.sebastien@gmail.com>
This commit is contained in:
parent
cc7f43580c
commit
70ba9d2d01
8 changed files with 113 additions and 21 deletions
|
@ -57,12 +57,14 @@ export function paginateBlogPosts({
|
|||
blogTitle,
|
||||
blogDescription,
|
||||
postsPerPageOption,
|
||||
pageBasePath,
|
||||
}: {
|
||||
blogPosts: BlogPost[];
|
||||
basePageUrl: string;
|
||||
blogTitle: string;
|
||||
blogDescription: string;
|
||||
postsPerPageOption: number | 'ALL';
|
||||
pageBasePath: string;
|
||||
}): BlogPaginated[] {
|
||||
const totalCount = blogPosts.length;
|
||||
const postsPerPage =
|
||||
|
@ -73,7 +75,7 @@ export function paginateBlogPosts({
|
|||
|
||||
function permalink(page: number) {
|
||||
return page > 0
|
||||
? normalizeUrl([basePageUrl, `page/${page + 1}`])
|
||||
? normalizeUrl([basePageUrl, pageBasePath, `${page + 1}`])
|
||||
: basePageUrl;
|
||||
}
|
||||
|
||||
|
@ -111,6 +113,7 @@ export function getBlogTags({
|
|||
blogTitle: string;
|
||||
blogDescription: string;
|
||||
postsPerPageOption: number | 'ALL';
|
||||
pageBasePath: string;
|
||||
}): BlogTags {
|
||||
const groups = groupTaggedItems(
|
||||
blogPosts,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue