Files
txarli.dev/src/components/Post.astro
2022-10-23 23:26:41 -05:00

30 lines
538 B
Plaintext

---
// import Tag from './Tag.astro';
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("en-us", {
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>