39 lines
733 B
Plaintext
39 lines
733 B
Plaintext
---
|
|
import type { CollectionEntry } from "astro:content";
|
|
|
|
interface Props {
|
|
post: CollectionEntry<"posts">;
|
|
}
|
|
|
|
const {
|
|
post: {
|
|
data: { slug, title, tags, description, added: date },
|
|
},
|
|
}: Props = Astro.props;
|
|
---
|
|
|
|
<li class="post">
|
|
<a href={`/post/${slug}/`} class="title">{title}</a>
|
|
<time datetime={date as string}>
|
|
{
|
|
new Date(date).toLocaleDateString("eu", {
|
|
year: "numeric",
|
|
month: "short",
|
|
day: "numeric",
|
|
})
|
|
}
|
|
</time>
|
|
<br />
|
|
{description && <span class="excerpt">{description}</span>}
|
|
<div>
|
|
{
|
|
tags &&
|
|
tags.map((tag: string) => (
|
|
<a class="tag" href={`/tag/${tag}`}>
|
|
#{tag}
|
|
</a>
|
|
))
|
|
}
|
|
</div>
|
|
</li>
|