补充内容

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

1414
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

41
src/apps/footer.tsx Normal file
View File

@@ -0,0 +1,41 @@
import { wrapBasename } from "@/modules/basename"
export const Footer = () => {
const links = [
{
href: wrapBasename('/'),
label: '主页',
},
{
href: wrapBasename('/docs'),
label: '文档',
},
]
return (
<footer className="fixed bottom-0 w-full bg-white border-t border-gray-200 shadow-lg">
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4">
{/* 链接区域 */}
<nav className="flex flex-wrap justify-center items-center gap-2 sm:gap-4 mb-3">
{links.map((link) => (
<a
key={link.href}
href={link.href}
className="relative px-4 py-2 text-sm sm:text-base font-medium text-gray-600 hover:text-blue-600 transition-all duration-300 ease-in-out
before:absolute before:bottom-0 before:left-0 before:w-0 before:h-0.5 before:bg-blue-600 before:transition-all before:duration-300
hover:before:w-full active:scale-95"
>
{link.label}
</a>
))}
</nav>
{/* 版权信息 */}
<div className="text-center text-xs sm:text-sm text-gray-500">
&copy; 2025 Daily Question
</div>
</div>
</footer>
)
}

View File

@@ -1,4 +1,12 @@
// @ts-ignore
export const basename = BASE_NAME;
console.log(basename);
console.log(basename);
export const wrapBasename = (path: string) => {
if (basename) {
return `${basename}${path}/`;
} else {
return path;
}
}

15
src/modules/query.ts Normal file
View File

@@ -0,0 +1,15 @@
import { Query } from '@kevisual/query'
const getUrl = () => {
const host = window.location.host
const isKevisual = host.includes('kevisual');
if (isKevisual) {
return '/api/router'
}
return '/client/router'
}
export const query = new Query({
url: getUrl()
});

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