Files
txarli.dev/src/components/Post.astro
T
2025-11-03 18:24:46 +01:00

29 lines
501 B
Plaintext

---
const { slug, title, tags, description, date } = Astro.props;
---
<li class="post">
<a href={`/post/${slug}/`} class="title">{title}</a>
<time datetime={date}>
{
new Date(date).toLocaleDateString("eu", {
year: "numeric",
month: "short",
day: "numeric",
})
}
</time>
<br />
{description && <span class="excerpt">{description}</span>}
<div>
{
tags &&
tags.map((tag) => (
<a class="tag" href={`/tag/${tag}`}>
#{tag}
</a>
))
}
</div>
</li>