feat: add links to tags
Some checks failed
Deploy to SFTP Server / build (push) Has been cancelled

This commit is contained in:
max_richter 2024-04-07 02:45:06 +02:00
parent 0ab1e1068d
commit 7c331406a5
2 changed files with 18 additions and 16 deletions

View File

@ -21,28 +21,30 @@ interface Props {
const { post } = Astro.props;
---
<a
href={tp(`/${post.collection}/${post.slug.split("/")[0]}`)}
class="rounded-diag-md border border-neutral p-4 overflow-hidden"
>
<h2
class="text-2xl flex gap-2 items-center line-clamp text-ellipsis overflow-hidden"
>
{post.data.icon && <img src={post.data.icon} class="h-6" />}
{post.data.title}
</h2>
<p class="text-ellipsis overflow-hidden line-clamp-2">
{post.data.description || markdownToText(post.body).slice(0, 200)}
</p>
<div class="rounded-diag-md border border-neutral p-4 overflow-hidden">
<a href={tp(`/${post.collection}/${post.slug.split("/")[0]}`)}>
<h2
class="text-2xl flex gap-2 items-center line-clamp text-ellipsis overflow-hidden"
>
{post.data.icon && <img src={post.data.icon} class="h-6" />}
{post.data.title}
</h2>
<p class="text-ellipsis overflow-hidden line-clamp-2">
{post.data.description || markdownToText(post.body).slice(0, 200)}
</p>
</a>
{
post.data.tags && (
<div class="flex gap-2 mt-2">
{post.data.tags.map((tag) => (
<span class="text-xs border border-neutral p-2 rounded-md">
<a
href={tp(`/tag/${tag}`)}
class="text-xs border border-neutral p-2 rounded-md"
>
{tag}
</span>
</a>
))}
</div>
)
}
</a>
</div>

0
src/components/Tag.astro Normal file
View File