2026-08-11 10:25:27 +08:00
|
|
|
---
|
|
|
|
|
import BaseLayout from '@/layouts/BaseLayout.astro';
|
|
|
|
|
import Masthead from '@/components/Masthead.astro';
|
|
|
|
|
import PostList from '@/components/PostList.astro';
|
|
|
|
|
import { getPublicPosts, POSTS_PER_PAGE } from '@/lib/content';
|
|
|
|
|
import { siteConfig } from '@/site.config';
|
|
|
|
|
const posts = await getPublicPosts();
|
|
|
|
|
const total = Math.max(1, Math.ceil(posts.length / POSTS_PER_PAGE));
|
|
|
|
|
---
|
|
|
|
|
|
2026-08-12 23:25:07 +08:00
|
|
|
<BaseLayout hasMasthead={siteConfig.banner.enabled} navbarOverlay={siteConfig.banner.enabled && Boolean(siteConfig.banner.image)}>
|
|
|
|
|
{siteConfig.banner.enabled && <Fragment slot="masthead"><Masthead /></Fragment>}
|
2026-08-11 10:25:27 +08:00
|
|
|
<PostList posts={posts.slice(0, POSTS_PER_PAGE)} total={total} basePath="" />
|
|
|
|
|
</BaseLayout>
|