mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-11 08:07:26 +02:00
fix(content-blog): remove double leading slash in blog-only paginated view (#6918)
* fix(content-blog): Fix permalink function of paginateBlogPosts * add test Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
This commit is contained in:
parent
f4f4c1dfd8
commit
46b1027c4a
3 changed files with 226 additions and 51 deletions
|
@ -72,7 +72,9 @@ export function paginateBlogPosts({
|
|||
const pages: BlogPaginated[] = [];
|
||||
|
||||
function permalink(page: number) {
|
||||
return page > 0 ? `${basePageUrl}/page/${page + 1}` : basePageUrl;
|
||||
return page > 0
|
||||
? normalizeUrl([basePageUrl, `page/${page + 1}`])
|
||||
: basePageUrl;
|
||||
}
|
||||
|
||||
for (let page = 0; page < numberOfPages; page += 1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue