-
Notifications
You must be signed in to change notification settings - Fork 5
/
ArticleListLayout.astro
35 lines (31 loc) · 992 Bytes
/
ArticleListLayout.astro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---
import BaseLayout from "$layouts/BaseLayout.astro"
import ArticlePreview from "$components/shared/ArticlePreview.astro"
import ArticleListAside from "$components/articleList/ArticleListAside.astro"
import type { Article } from "$data/articles"
import type { MDXInstance, Page } from "$data/shared"
export interface Props {
page: Page<MDXInstance<Article>>
title: string
}
const { page, title } = Astro.props
---
<BaseLayout title={title}>
<article class="w-articleList mx-auto flex flex-col md:flex-row mt-4 sm:mt-6">
<div class="sm:w-[80%]">
<h2 class="mt-0">{title}</h2>
{page.data.map((item) => <ArticlePreview article={item.frontmatter} />)}
<div>
{page.url.prev && <a href={page.url.prev}>Newer posts</a>}
{
page.url.next && (
<a class="float-right" href={page.url.next}>
Older posts
</a>
)
}
</div>
</div>
<ArticleListAside />
</article>
</BaseLayout>