File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ import { getCollection , getEntry , render } from ' astro:content' ;
3+ import Author from ' @/components/ui/Author.astro' ;
4+ import Container from ' @/components/Container.astro' ;
5+ import BaseLayout from ' @/layouts/BaseLayout.astro' ;
6+ import { DEFAULT_CONFIGURATION } from ' @/lib/constants' ;
7+ import PostPreview from ' @/components/ui/PostPreview.astro' ;
8+
9+ const entry = await getEntry (' pages' , ' posts' );
10+
11+ if (! entry ) {
12+ throw new Error (' Posts content not found in src/content/pages' );
13+ }
14+ const posts = await getCollection (' posts' );
15+ ---
16+
17+ <BaseLayout >
18+ <section class =" py-6" >
19+ <Container >
20+ <Author {... DEFAULT_CONFIGURATION .author } />
21+ </Container >
22+ </section >
23+ <section class =" py-6" >
24+ <Container >
25+ <div class =" flex flex-col gap-6" >
26+ <span class =" text-headings" >Latest posts</span >
27+ <ul class =" flex flex-col gap-3" >
28+ { posts .map ((post ) => <PostPreview entry = { post } />)}
29+ </ul >
30+ </div >
31+ </Container >
32+ </section >
33+ </BaseLayout >
You can’t perform that action at this time.
0 commit comments