diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2024-01-25 15:22:02 +0000 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2024-01-25 15:22:02 +0000 |
| commit | 5542c18af3cebe63bcbd5fd6d54625af3ca4f2fe (patch) | |
| tree | f6326584d4ba56876f429eb2b0ece3e4a56986c2 /src/pages | |
| parent | 5fab0381b308eb5a1c837ffdd5e0ddd757e769d3 (diff) | |
| download | personal-website-5542c18af3cebe63bcbd5fd6d54625af3ca4f2fe.tar.gz personal-website-5542c18af3cebe63bcbd5fd6d54625af3ca4f2fe.tar.bz2 personal-website-5542c18af3cebe63bcbd5fd6d54625af3ca4f2fe.zip | |
Now displaying blog posts
Diffstat (limited to 'src/pages')
| -rw-r--r-- | src/pages/blog/index.astro | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/pages/blog/index.astro b/src/pages/blog/index.astro index 556be15..1ebc9e9 100644 --- a/src/pages/blog/index.astro +++ b/src/pages/blog/index.astro @@ -1,8 +1,19 @@ --- import Page from "../../layouts/Page.astro"; +import { getCollection } from "astro:content"; + +const allBlogPosts = await getCollection('blog'); --- <Page title="Blog" description="Where I post can be anything!"> <main> + {allBlogPosts.map((post) => ( + <article> + <h2>{post.data.title}</h2> + <sm>{post.data.date}</sm> + <p>{post.data.description}</p> + <a href={`/blog/${post.slug}`}>Read more</a> + </article> + )) </main> </Page> |
