补充内容

This commit is contained in:
2025-11-25 09:39:41 +08:00
parent 0810a1be5d
commit 90c2da923a
5 changed files with 1272 additions and 213 deletions

View File

@@ -1,7 +1,6 @@
---
import { getCollection } from 'astro:content';
const posts = await getCollection('docs');
console.log('post', posts);
import { basename } from '@/modules/basename';
import Blank from '@/layouts/blank.astro';
---
@@ -28,7 +27,7 @@ import Blank from '@/layouts/blank.astro';
<article class='group bg-white dark:bg-slate-800 rounded-xl shadow-sm hover:shadow-xl transition-all duration-300 overflow-hidden border border-slate-200 dark:border-slate-700 hover:border-blue-500 dark:hover:border-blue-400'>
<div class='p-6'>
{/* 文档标题 */}
<a href={`${basename}/docs/${post.id}`} class='block'>
<a href={`${basename}/docs/${post.id}/`} class='block'>
<h2 class='text-xl sm:text-2xl font-semibold text-slate-900 dark:text-white group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors duration-200 mb-3'>
{post.data.title}
</h2>
@@ -51,7 +50,7 @@ import Blank from '@/layouts/blank.astro';
{/* 阅读更多指示器 */}
<a
href={`${basename}/docs/${post.id}`}
href={`${basename}/docs/${post.id}/`}
class='mt-4 flex items-center text-blue-600 dark:text-blue-400 text-sm font-medium opacity-0 group-hover:opacity-100 transition-opacity duration-200'>
<span>阅读更多</span>
<svg