summaryrefslogtreecommitdiff
path: root/examples/blog/src/pages/index.astro
diff options
context:
space:
mode:
authorGravatar Drew Powers <1369770+drwpow@users.noreply.github.com> 2021-05-17 17:45:41 -0500
committerGravatar GitHub <noreply@github.com> 2021-05-17 17:45:41 -0500
commitd6cedac38e25fbec8425e020c16393fd70f0adf6 (patch)
tree4bda69f8ec6ab76d75f1f98b141886ce5305df4d /examples/blog/src/pages/index.astro
parentd8a78298f354e775c1a3ad8b2d44e372969b0c39 (diff)
downloadastro-d6cedac38e25fbec8425e020c16393fd70f0adf6.tar.gz
astro-d6cedac38e25fbec8425e020c16393fd70f0adf6.tar.zst
astro-d6cedac38e25fbec8425e020c16393fd70f0adf6.zip
Improve blog template (#217)
Diffstat (limited to 'examples/blog/src/pages/index.astro')
-rw-r--r--examples/blog/src/pages/index.astro8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/blog/src/pages/index.astro b/examples/blog/src/pages/index.astro
index 19ea4ebf9..a4407378c 100644
--- a/examples/blog/src/pages/index.astro
+++ b/examples/blog/src/pages/index.astro
@@ -5,7 +5,7 @@ import PostPreview from '../components/PostPreview.astro';
import Pagination from '../components/Pagination.astro';
// page
-let title = 'Muppet Blog: Home';
+let title = 'Don’s Blog';
let description = 'An example blog on Astro';
// collection
@@ -15,7 +15,7 @@ import authorData from '../data/authors.json';
let allPosts = Astro.fetchContent('./post/*.md');
allPosts.sort((a, b) => new Date(b.date) - new Date(a.date));
-let firstThree = allPosts.slice(0, 3);
+let firstPage = allPosts.slice(0, 2);
---
<html>
@@ -24,6 +24,7 @@ let firstThree = allPosts.slice(0, 3);
<MainHead
title={title}
description={description}
+ image={firstPage[0].image}
canonicalURL={Astro.request.canonicalURL.href}
/>
</head>
@@ -32,8 +33,7 @@ let firstThree = allPosts.slice(0, 3);
<Nav />
<main class="wrapper">
- <h1>Recent posts</h1>
- {firstThree.map((post) => <PostPreview post={post} author={authorData[post.author]} />)}
+ {firstPage.map((post) => <PostPreview post={post} author={authorData[post.author]} />)}
</main>
<footer>