Skip to content

Commit

Permalink
Actually use the publication date from frontmatter
Browse files Browse the repository at this point in the history
  • Loading branch information
hazelthatsme authored Jan 18, 2024
1 parent 955fbc9 commit daec477
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/layouts/BlogLayout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ const { frontmatter } = Astro.props;
<a href="/">Back to root</a>
<article>
<h1>{frontmatter.title}</h1>
<i class="pub">January 1st, 2024</i>
<i class="pub">{new Date(frontmatter.pubDate).toLocaleDateString("en-US", {
year: 'numeric',
month: 'long',
day: 'numeric'
})}</i>
<slot />
</article>
</main>
Expand All @@ -32,4 +36,4 @@ const { frontmatter } = Astro.props;
font-size: 3em;
margin: 0;
}
</style>
</style>

0 comments on commit daec477

Please sign in to comment.