--- import { getCollection } from 'astro:content'; const posts = await getCollection('docs'); import { basename, wrapBasename } from '@/modules/basename'; import Blank from '@/layouts/blank.astro'; ---
{/* 页面标题区域 */}

📚 文档列表

浏览所有可用的文档资源

{/* 文档列表 */}
{ posts.map((post) => { const tags = post.data.tags || []; const postUrl = wrapBasename(`/docs/${post.id}`); return (
{/* 文档标题 */}

{post.data.title}

{/* 文档描述(如果有) */} {post.data.description &&

{post.data.description}

} {/* 标签列表 */} {tags.length > 0 && (
{tags.map((tag) => (
# {tag}
))}
)} {/* 阅读更多指示器 */} 阅读更多
); }) }
{/* 空状态 */} { posts.length === 0 && (
📭

暂无文档

) }