Skip to content

Commit c7291c8

Browse files
authored
fix: Blog pagination / Blog category listing (#6113)
1 parent a5a3815 commit c7291c8

File tree

16 files changed

+19
-19
lines changed

16 files changed

+19
-19
lines changed

components/withLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import type { LegacyLayouts } from '@/types';
1414
const layoutComponents = {
1515
'docs.hbs': DocsLayout,
1616
'about.hbs': AboutLayout,
17-
'blog-categpry.hbs': BlogCategoryLayout,
17+
'blog-category.hbs': BlogCategoryLayout,
1818
'blog-post.hbs': BlogPostLayout,
1919
'contribute.hbs': ContributeLayout,
2020
'download.hbs': DownloadLayout,

hooks/useBaseBlogData.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ export const useBaseBlogData = (pathname: string) => {
2525
};
2626

2727
const currentCategory = useMemo(() => {
28-
// We split the pathname to retrieve the blog category from it
29-
// since the URL is usually /{languageCode}/blog/{category}
30-
// the third path piece is usually the category name
31-
const [, _pathname, category] = pathname.split('/');
28+
// We split the pathname to retrieve the blog category from it since the
29+
// URL is usually blog/{category} the second path piece is usually the
30+
// category name
31+
const [_pathname, category] = pathname.split('/');
3232

3333
if (_pathname === 'blog' && category && category.length) {
3434
return category;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
22
title: Advisory Board
3-
layout: blog-categpry.hbs
3+
layout: blog-category.hbs
44
---
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
22
title: Announcements
3-
layout: blog-categpry.hbs
3+
layout: blog-category.hbs
44
---

pages/en/blog/community/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
22
title: Community
3-
layout: blog-categpry.hbs
3+
layout: blog-category.hbs
44
---

pages/en/blog/feature/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
22
title: Features
3-
layout: blog-categpry.hbs
3+
layout: blog-category.hbs
44
---

pages/en/blog/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
22
title: News
3-
layout: blog-categpry.hbs
3+
layout: blog-category.hbs
44
---

pages/en/blog/module/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
22
title: Modules
3-
layout: blog-categpry.hbs
3+
layout: blog-category.hbs
44
---

pages/en/blog/npm/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
22
title: NPM
3-
layout: blog-categpry.hbs
3+
layout: blog-category.hbs
44
---

pages/en/blog/pagination.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
22
title: News from
3-
layout: blog-categpry.hbs
3+
layout: blog-category.hbs
44
author: The Node.js Project
55
---

0 commit comments

Comments
 (0)