Blog post author, version

This commit is contained in:
Firq 2023-03-19 13:14:50 +01:00
parent 82d800d6f8
commit 18fd2da104
Signed by: Firq
GPG key ID: 4DE1059A4666E89F
3 changed files with 5 additions and 3 deletions

View file

@ -1,7 +1,7 @@
{
"name": "@firq/fgosite",
"type": "module",
"version": "0.1.1",
"version": "0.1.2",
"private": true,
"scripts": {
"dev": "astro dev",

View file

@ -4,6 +4,7 @@ export interface Props {
title: string
pubdate: string
description: string
author: string
}
const options_date: Intl.DateTimeFormatOptions = {
@ -11,7 +12,7 @@ const options_date: Intl.DateTimeFormatOptions = {
month: 'long',
day: '2-digit',
}
const { description, pubdate, url, title } = Astro.props
const { author, description, pubdate, url, title } = Astro.props
const date = new Date(pubdate).toLocaleDateString('en-GB', options_date)
---
@ -19,7 +20,7 @@ const date = new Date(pubdate).toLocaleDateString('en-GB', options_date)
<div class="circle"></div>
<article>
<h2>{title}</h2>
<h3>{date}</h3>
<h3>{date} • Written by {author}</h3>
<p>{description}</p>
</article>
</a>

View file

@ -25,6 +25,7 @@ allPosts.sort(
title={post.frontmatter.title}
pubdate={post.frontmatter.pubDate}
description={post.frontmatter.description}
author={post.frontmatter.author}
/>
))
}