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", "name": "@firq/fgosite",
"type": "module", "type": "module",
"version": "0.1.1", "version": "0.1.2",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "astro dev", "dev": "astro dev",

View file

@ -4,6 +4,7 @@ export interface Props {
title: string title: string
pubdate: string pubdate: string
description: string description: string
author: string
} }
const options_date: Intl.DateTimeFormatOptions = { const options_date: Intl.DateTimeFormatOptions = {
@ -11,7 +12,7 @@ const options_date: Intl.DateTimeFormatOptions = {
month: 'long', month: 'long',
day: '2-digit', 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) 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> <div class="circle"></div>
<article> <article>
<h2>{title}</h2> <h2>{title}</h2>
<h3>{date}</h3> <h3>{date} • Written by {author}</h3>
<p>{description}</p> <p>{description}</p>
</article> </article>
</a> </a>

View file

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