File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments