Make post component, style list

This commit is contained in:
Cassidy Williams
2022-08-24 00:30:12 -05:00
parent 0af0bcd885
commit 8cf3601874
4 changed files with 45 additions and 14 deletions

View File

@@ -12,11 +12,8 @@ import { SITE_TITLE } from "../config";
</div>
<nav>
<HeaderLink href="/">home</HeaderLink>
<HeaderLink href="/blog">posts</HeaderLink>
<HeaderLink href="/posts">posts</HeaderLink>
<HeaderLink href="https://cassidoo.co" target="_blank">website</HeaderLink>
<HeaderLink href="https://twitter.com/cassidoo" target="_blank"
>twitter
</HeaderLink>
<HeaderLink href="https://cassidoo.co/newsletter" target="_blank"
>newsletter
</HeaderLink>

24
src/components/Post.astro Normal file
View File

@@ -0,0 +1,24 @@
---
// import Tag from './Tag.astro';
const { slug, title, tags, description, date } = Astro.props;
---
<li>
<a href={`/${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>}
<ul>
{tags && tags.map(tag => (
<li class="tag">
<div>{tag}</div>
</li>
))}
</ul>
</li>