--- import Layout from "@/layouts/Layout.astro"; import type {Archive} from "@/types/archive"; import {createHttp} from "@/lib/request"; const http = createHttp(Astro.request.headers); const {data} = await http.get>("posts/archives"); ---
{ data.map((year) => (

{year.year}年 共 {year.total} 篇

{year.list.map((month) => (

{month.month} 月

    {month.list.map((post) => (
  • {post.title} {post.category_name}
  • ))}
))}
)) }