diff options
Diffstat (limited to 'src/components/Sections/LatestPosts.astro')
-rw-r--r-- | src/components/Sections/LatestPosts.astro | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/components/Sections/LatestPosts.astro b/src/components/Sections/LatestPosts.astro index 070dc46..e91cb4c 100644 --- a/src/components/Sections/LatestPosts.astro +++ b/src/components/Sections/LatestPosts.astro @@ -1,6 +1,7 @@ --- import { getCollection } from "astro:content"; import dayjs from "dayjs"; +import RSSIcon from "../Icons/RSS.astro"; const posts = await getCollection("blog", ({ data }) => { return data.draft !== true; @@ -21,7 +22,7 @@ const latestPosts = posts.slice(0, 5); </style> <section> - <h2>Latest posts</h2> + <h2>Latest posts <RSSIcon /></h2> <ul> { latestPosts.map((post) => ( @@ -29,7 +30,12 @@ const latestPosts = posts.slice(0, 5); <a href={`/blog/${post.slug}`} lang={post.data.lang}> {post.data.title} </a> - <small>{dayjs(post.data.pubDate.toString()).format("MMMM DD, YYYY")}</small> + + <small> + <time datetime={post.data.pubDate.toISOString()} lang="en"> + {dayjs(post.data.pubDate.toString()).format("MMMM DD, YYYY")} + </time> + </small> </li> )) } |