File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -36,13 +36,19 @@ export const PAGE_METADATA = {
36
36
'lists/blog/tags' : {
37
37
title : 'Tags' ,
38
38
} ,
39
+ 'lists/blog/tags/tag' : {
40
+ title : 'Tag' ,
41
+ } ,
39
42
// 'src/pages/blog/tags/[tag]/[...page].astro' // dynamic tag param
40
43
'lists/blog/explore' : {
41
44
title : 'Explore' ,
42
45
} ,
43
46
'lists/blog/categories' : {
44
47
title : 'Categories' ,
45
48
} ,
49
+ 'lists/blog/categories/category' : {
50
+ title : 'Category' ,
51
+ } ,
46
52
// src/pages/blog/categories/[category]/[...page].astro
47
53
'lists/projects' : {
48
54
title : 'Projects' ,
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import Link from '@/components/Link.astro';
6
6
import PostList from ' @/components/PostList.astro' ;
7
7
import { ROUTES } from ' @/constants/routes' ;
8
8
import { CONFIG } from ' @/config' ;
9
+ import { getPageMetadata } from ' @/utils/metadata' ;
9
10
import { pickPaginationPropsFromPage } from ' @/utils/pagination' ;
10
11
import { capitalizeFirstLetter } from ' @/utils/strings' ;
11
12
@@ -32,8 +33,10 @@ export async function getStaticPaths({ paginate }: GetStaticPathsOptions) {
32
33
const { page } = Astro .props ;
33
34
const { category } = Astro .params ;
34
35
36
+ const defaultMetadata = getPageMetadata (' lists/blog/categories/category' );
37
+
35
38
const title = capitalizeFirstLetter (category );
36
- const metadata: Metadata = { title };
39
+ const metadata: Metadata = { ... defaultMetadata , title };
37
40
38
41
const paginationProps = pickPaginationPropsFromPage (page );
39
42
const layoutProps = { metadata , paginationProps };
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import Link from '@/components/Link.astro';
6
6
import PostList from ' @/components/PostList.astro' ;
7
7
import { ROUTES } from ' @/constants/routes' ;
8
8
import { CONFIG } from ' @/config' ;
9
+ import { getPageMetadata } from ' @/utils/metadata' ;
9
10
import { pickPaginationPropsFromPage } from ' @/utils/pagination' ;
10
11
11
12
import type { Metadata } from ' @/types/common' ;
@@ -31,9 +32,11 @@ export async function getStaticPaths({ paginate }: GetStaticPathsOptions) {
31
32
const { page } = Astro .props ;
32
33
const { tag } = Astro .params ;
33
34
34
- // todo: dynamic param for metadata
35
35
const title = ` #${tag } ` ;
36
- const metadata: Metadata = { title };
36
+
37
+ // dynamic param for metadata
38
+ const defaultMetadata = getPageMetadata (' lists/blog/tags/tag' );
39
+ const metadata: Metadata = { ... defaultMetadata , title };
37
40
38
41
const paginationProps = pickPaginationPropsFromPage (page );
39
42
const layoutProps = { metadata , paginationProps };
You can’t perform that action at this time.
0 commit comments