aboutsummaryrefslogtreecommitdiff
path: root/src/pages/blog/index.astro
blob: 1ebc9e92e2630f52b6873a073271f2b7ea8aade7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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>