Skip to content

Commit fc32da3

Browse files
committed
fix bug
1 parent ab88d01 commit fc32da3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/utils/content-utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ export async function getTagList(): Promise<Tag[]> {
3737
});
3838

3939
const countMap: { [key: string]: number } = {};
40-
allBlogPosts.map((post: { data: { tags: string[] } }) => {
41-
post.data.tags.map((tag: string) => {
40+
allBlogPosts.forEach((post: { data: { tags: string[] } }) => {
41+
post.data.tags.forEach((tag: string) => {
4242
if (!countMap[tag]) countMap[tag] = 0;
4343
countMap[tag]++;
4444
});
@@ -63,7 +63,7 @@ export async function getCategoryList(): Promise<Category[]> {
6363
return import.meta.env.PROD ? data.draft !== true : true;
6464
});
6565
const count: { [key: string]: number } = {};
66-
allBlogPosts.map((post: { data: { category: string | null } }) => {
66+
allBlogPosts.forEach((post: { data: { category: string | null } }) => {
6767
if (!post.data.category) {
6868
const ucKey = i18n(I18nKey.uncategorized);
6969
count[ucKey] = count[ucKey] ? count[ucKey] + 1 : 1;

0 commit comments

Comments
 (0)