Skip to content

Commit

Permalink
add tag page in search
Browse files Browse the repository at this point in the history
  • Loading branch information
Vahor committed Apr 28, 2024
1 parent 13313e7 commit 27e923d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/app/tag/[tag]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function TagPage({ params }: PageProps) {
<h1 className="text-3xl font-semibold text-black dark:text-white capitalize">
{params.tag}
</h1>
<ul className="divide-y space-y-4">
<ul className="divide-y space-y-4 mt-8">
{filteredPosts.map((post) => (
<li key={post.url}>
<PostEntry post={post} />
Expand All @@ -61,9 +61,12 @@ export default function TagPage({ params }: PageProps) {

const PostEntry = ({ post }: { post: Post }) => {
return (
<div className="mt-4 space-y-1">
<div className="mt-4 space-y-1 group">
<div className="flex gap-2 justify-between">
<Link href={post.url} className="text-black dark:text-white">
<Link
href={post.url}
className="group-hover:text-black group-hover:dark:text-white"
>
<h2>{post.title}</h2>
</Link>
<time
Expand All @@ -75,7 +78,7 @@ const PostEntry = ({ post }: { post: Post }) => {
})}
</time>
</div>
<p>{post.description}</p>
<p className="text-muted-foreground">{post.description}</p>
</div>
);
};
7 changes: 7 additions & 0 deletions src/lib/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ const search_content = [
pageType: "app",
external: false,
})),
{
title: "Liste des articles",
datePublished: env.NEXT_PUBLIC_BUILD_TIME,
url: "/tag/project",
pageType: "app",
external: false,
},
...contact_links.map((l) => ({
title: l.label,
datePublished: env.NEXT_PUBLIC_BUILD_TIME,
Expand Down

0 comments on commit 27e923d

Please sign in to comment.