diff --git a/README.md b/README.md index d8d01b7b4..e465d2e05 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ export default { astroRoot: './astro', /** When running `astro build`, path to final static output */ dist: './_site', - /** A folder of static files Astro will copy to the root. Useful for favicons, images, and other files that don‘t need processing. */ + /** A folder of static files Astro will copy to the root. Useful for favicons, images, and other files that don’t need processing. */ public: './public', /** Extension-specific handlings */ extensions: { @@ -80,7 +80,7 @@ Our goal is to support all popular state management libraries, as long as there ### 💅 Styling -If you‘ve used [Svelte][svelte]’s styles before, Astro works almost the same way. In any `.astro` file, start writing styles in a ` + + diff --git a/examples/blog/astro/pages/$posts.astro b/examples/blog/astro/pages/$posts.astro new file mode 100644 index 000000000..ae4bcb223 --- /dev/null +++ b/examples/blog/astro/pages/$posts.astro @@ -0,0 +1,48 @@ +--- +import MainHead from '../components/MainHead.astro'; +import Nav from '../components/Nav.astro'; +import PostPreview from '../components/PostPreview.astro'; +import Pagination from '../components/Pagination.astro'; + +// page +let title = 'Muppet Blog: Home'; +let description = 'An example blog on Astro'; + +// collection +import authorData from '../data/authors.json'; +export let collection: any; +export async function createCollection() { + return { + async data() { + let allPosts = await import.meta.fetchContent('./post/*.md'); + allPosts.sort((a, b) => new Date(b.date) - new Date(a.date)); + return allPosts; + }, + pageSize: 3 + }; +} +--- + + + + {title} + + + {collection.url.next && } + {collection.url.prev && } + + + +