mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-22 13:37:05 +02:00
chore(v2): use normalizeUrl instead of path.join (#1428)
* chore(v2): use normalizeUrl instead of path.join * address review
This commit is contained in:
parent
a4ca603222
commit
a1ee1ab140
1 changed files with 5 additions and 5 deletions
|
@ -99,15 +99,15 @@ class DocusaurusPluginContentBlog {
|
|||
// Blog page handling. Example: `/blog`, `/blog/page1`, `/blog/page2`
|
||||
const numOfBlog = blogMetadata.length;
|
||||
const numberOfPage = Math.ceil(numOfBlog / pageCount);
|
||||
const basePageUrl = path.join(baseUrl, routeBasePath);
|
||||
const basePageUrl = normalizeUrl([baseUrl, routeBasePath]);
|
||||
|
||||
// eslint-disable-next-line
|
||||
for (let page = 0; page < numberOfPage; page++) {
|
||||
blogMetadata.push({
|
||||
permalink: normalizeUrl([
|
||||
basePageUrl,
|
||||
`${page > 0 ? `page${page + 1}` : ''}`,
|
||||
]),
|
||||
permalink:
|
||||
page > 0
|
||||
? normalizeUrl([basePageUrl, `page/${page + 1}`])
|
||||
: basePageUrl,
|
||||
language: defaultLangTag,
|
||||
isBlogPage: true,
|
||||
posts: blogMetadata.slice(page * pageCount, (page + 1) * pageCount),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue