Skip to content

Commit

Permalink
fix: category in tag detail page
Browse files Browse the repository at this point in the history
  • Loading branch information
vhnam committed Jun 1, 2024
1 parent 6ad3014 commit fe2264a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/pages/hobbies/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const tags = await getTags(posts);

<section class="basis-full md:basis-9/12">
<div class="mb-12 min-w-full">
<ul>
<ul class="flex flex-col gap-4 md:gap-6 pb-6">
{
posts.map((post) => (
<PostItem post={post} category="hobbies" />
Expand Down
3 changes: 2 additions & 1 deletion src/pages/tags/[...tag].astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
import { getCollection } from "astro:content";
import pluralize from "pluralize";
import { GA_MEASUREMENT_ID } from "../../consts";
Expand Down Expand Up @@ -58,7 +59,7 @@ const expectedTag = (tags as any)[tag];
<ul class="flex flex-col gap-4 md:gap-6 pb-6">
{
expectedTag.posts.map((post: any) => (
<PostItem post={post} category={post.category} />
<PostItem post={post} category={pluralize(post.collection)} />
))
}
</ul>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/tags/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const tags = await getTags(posts);

<Nav />

<main class="mt-10">
<div class="flex justify-center flex-wrap gap-4">
<main class="mt-10 container mx-auto">
<div class="flex justify-center flex-wrap gap-4 md:gap-6">
{
Object.keys(tags).map((tag) => (
<a
Expand Down
2 changes: 1 addition & 1 deletion src/pages/tutorials/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const tags = await getTags(posts);

<section class="basis-full md:basis-9/12">
<div class="mb-12 min-w-full">
<ul>
<ul class="flex flex-col gap-4 md:gap-6 pb-6">
{
posts.map((post) => (
<PostItem post={post} category="tutorials" />
Expand Down

0 comments on commit fe2264a

Please sign in to comment.