Files
blog-frontend-v2/src/pages/blogs.astro
passthem aa33703b8b
All checks were successful
continuous-integration/drone/push Build is passing
手机端兼容与加载条
2026-04-01 17:26:44 +08:00

43 lines
819 B
Plaintext

---
import FullLayoutV1 from '../layout/FullLayoutV1.astro'
import { listBlogs } from '../lib/apis/legacy/blog'
export const prerender = false
const _page = parseInt(Astro.url.searchParams.get('page') || '1')
const page = isNaN(_page) ? 1 : Math.max(1, _page)
const blogs = await listBlogs({ page })
---
<FullLayoutV1>
<div class="__dev__caution">
<h1>仍在开发中,界面会崩坏</h1>
</div>
<section>
<ul>
{
blogs.map((blog) => (
<li>
<a href={`/blogs/${blog.id}`}>{blog.title}</a>
</li>
))
}
</ul>
</section>
</FullLayoutV1>
<style>
.__dev__caution {
height: 100dvh;
display: flex;
align-items: center;
justify-content: center;
& > h1 {
font-size: 72px;
font-weight: 800;
}
}
</style>