Skip to content

Commit 1d36741

Browse files
Merge pull request #100 from odedniv/category-name
category page title to use real category name
2 parents 47ea216 + 928380a commit 1d36741

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/pages/category/[category]/[page].astro

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,14 @@ const params = Astro.params
2929
const { page } = Astro.props
3030
3131
const unsluglifyNameCategory = unsluglify(params.category!.toLowerCase())
32+
const categoryName = (await getCategories()).find(
33+
(category) => category.toLowerCase() === unsluglifyNameCategory
34+
)
3235
const posts = page.data
3336
---
3437

35-
<BaseLayout title={params.category}>
36-
<TitlePage title={unsluglifyNameCategory} />
38+
<BaseLayout title={categoryName}>
39+
<TitlePage title={categoryName} />
3740
<ListCategories activeCategory={params.category} />
3841
<ListPosts posts={posts} />
3942
<Pagination page={page} />

0 commit comments

Comments
 (0)