summaryrefslogtreecommitdiff
path: root/examples/blog/src/pages/blog.astro
diff options
context:
space:
mode:
Diffstat (limited to 'examples/blog/src/pages/blog.astro')
-rw-r--r--examples/blog/src/pages/blog.astro6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/blog/src/pages/blog.astro b/examples/blog/src/pages/blog.astro
index 1ba45a36c..73576c498 100644
--- a/examples/blog/src/pages/blog.astro
+++ b/examples/blog/src/pages/blog.astro
@@ -7,7 +7,7 @@ import { SITE_TITLE, SITE_DESCRIPTION } from '../config';
// Use Astro.glob() to fetch all posts, and then sort them by date.
const posts = (await Astro.glob('./blog/*.{md,mdx}')).sort(
(a, b) =>
- new Date(b.frontmatter.publishDate).valueOf() - new Date(a.frontmatter.publishDate).valueOf()
+ new Date(b.frontmatter.pubDate).valueOf() - new Date(a.frontmatter.pubDate).valueOf()
);
---
@@ -40,8 +40,8 @@ const posts = (await Astro.glob('./blog/*.{md,mdx}')).sort(
<ul>
{posts.map((post) => (
<li>
- <time datetime={post.frontmatter.publishDate}>
- {new Date(post.frontmatter.publishDate).toLocaleDateString('en-us', {
+ <time datetime={post.frontmatter.pubDate}>
+ {new Date(post.frontmatter.pubDate).toLocaleDateString('en-us', {
year: 'numeric',
month: 'short',
day: 'numeric',