diff options
Diffstat (limited to 'examples/with-content/src/pages/blog/index.astro')
-rw-r--r-- | examples/with-content/src/pages/blog/index.astro | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/examples/with-content/src/pages/blog/index.astro b/examples/with-content/src/pages/blog/index.astro index e4f769f8a..c46f23dea 100644 --- a/examples/with-content/src/pages/blog/index.astro +++ b/examples/with-content/src/pages/blog/index.astro @@ -7,7 +7,7 @@ import { getCollection } from 'astro:content'; const posts = (await getCollection('blog')).sort( (a, b) => a.data.pubDate.valueOf() - b.data.pubDate.valueOf() -) +); --- <!DOCTYPE html> @@ -37,18 +37,20 @@ const posts = (await getCollection('blog')).sort( <main> <section> <ul> - {posts.map((post) => ( - <li> - <time datetime={post.data.pubDate.toISOString()}> - {post.data.pubDate.toLocaleDateString('en-us', { - year: 'numeric', - month: 'short', - day: 'numeric', - })} - </time> - <a href={'/blog/' + post.slug}>{post.data.title}</a> - </li> - ))} + { + posts.map((post) => ( + <li> + <time datetime={post.data.pubDate.toISOString()}> + {post.data.pubDate.toLocaleDateString('en-us', { + year: 'numeric', + month: 'short', + day: 'numeric', + })} + </time> + <a href={'/blog/' + post.slug}>{post.data.title}</a> + </li> + )) + } </ul> </section> </main> |