Missing firstPage (#658)

This commit is contained in:
outcastgeek 2021-07-11 15:05:19 -04:00 committed by GitHub
parent d46746c34f
commit c48acb3d84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,6 +16,7 @@ let description = 'An example blog on Astro';
// Data Fetching: List all Markdown posts in the repo. // Data Fetching: List all Markdown posts in the repo.
let allPosts = Astro.fetchContent('./post/*.md'); let allPosts = Astro.fetchContent('./post/*.md');
allPosts.sort((a, b) => new Date(b.date) - new Date(a.date)); allPosts.sort((a, b) => new Date(b.date) - new Date(a.date));
let firstPage = allPosts.slice(0, 2);
// Full Astro Component Syntax: // Full Astro Component Syntax:
// https://github.com/snowpackjs/astro/blob/main/docs/core-concepts/astro-components.md // https://github.com/snowpackjs/astro/blob/main/docs/core-concepts/astro-components.md