Skip to content

Commit

Permalink
Add descriptions to writings list
Browse files Browse the repository at this point in the history
  • Loading branch information
basham committed May 28, 2024
1 parent 342cec1 commit 0ec2cb3
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
33 changes: 32 additions & 1 deletion src/components/Writings.astro
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,39 @@ const posts = (await getCollection('writings'))
{
posts.map((post) => (
<li>
<a href={`/${slugFromPost(post)}`}>{post.data.title}</a> ({post.data.pubDate.getFullYear()})
<h3>
<a href={`/${slugFromPost(post)}`}>{post.data.title}</a>
</h3>
<p class="pubdate">{post.data.pubDate.getFullYear()}</p>
<p class="description">{post.data.description}</p>
</li>
))
}
</ul>

<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
}

li {
align-items: baseline;
display: flex;
flex-wrap: wrap;
gap: var(--8px) var(--16px);
margin: 0;
}

.pubdate {
color: var(--color-muted);
font-size: var(--fs-0);
margin: 0;
}

.description {
flex-basis: 100%;
margin: 0;
}
</style>
2 changes: 1 addition & 1 deletion src/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ h1 {

h2 {
font-size: var(--fs-3);
margin: 1.5em 0 0;
margin: 2em 0 0;
}

h3 {
Expand Down

0 comments on commit 0ec2cb3

Please sign in to comment.