chore: checkpoint ai search comments and i18n foundation

This commit is contained in:
2026-03-28 17:17:31 +08:00
parent d18a709987
commit ec96d91548
71 changed files with 9494 additions and 423 deletions

View File

@@ -6,10 +6,14 @@ import StatsList from '../../components/StatsList.astro';
import TechStackList from '../../components/TechStackList.astro';
import InfoTile from '../../components/ui/InfoTile.astro';
import { api, DEFAULT_SITE_SETTINGS } from '../../lib/api/client';
import { getI18n } from '../../lib/i18n';
export const prerender = false;
let siteSettings = DEFAULT_SITE_SETTINGS;
let systemStats = [];
let techStack = [];
const { t } = getI18n(Astro);
try {
const [settings, posts, tags, friendLinks] = await Promise.all([
@@ -22,26 +26,26 @@ try {
siteSettings = settings;
techStack = siteSettings.techStack.map(name => ({ name }));
systemStats = [
{ label: 'Posts', value: String(posts.length) },
{ label: 'Tags', value: String(tags.length) },
{ label: 'Friends', value: String(friendLinks.filter(friend => friend.status === 'approved').length) },
{ label: 'Location', value: siteSettings.location || 'Unknown' },
{ label: t('common.posts'), value: String(posts.length) },
{ label: t('common.tags'), value: String(tags.length) },
{ label: t('common.friends'), value: String(friendLinks.filter(friend => friend.status === 'approved').length) },
{ label: t('common.location'), value: siteSettings.location || t('common.unknown') },
];
} catch (error) {
console.error('Failed to load about data:', error);
techStack = siteSettings.techStack.map(name => ({ name }));
systemStats = [
{ label: 'Posts', value: '0' },
{ label: 'Tags', value: '0' },
{ label: 'Friends', value: '0' },
{ label: 'Location', value: siteSettings.location || 'Unknown' },
{ label: t('common.posts'), value: '0' },
{ label: t('common.tags'), value: '0' },
{ label: t('common.friends'), value: '0' },
{ label: t('common.location'), value: siteSettings.location || t('common.unknown') },
];
}
const ownerInitial = siteSettings.ownerName.charAt(0) || 'T';
---
<BaseLayout title={`关于 - ${siteSettings.siteShortName}`} description={siteSettings.siteDescription}>
<BaseLayout title={`${t('about.pageTitle')} - ${siteSettings.siteShortName}`} description={siteSettings.siteDescription}>
<div class="max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<TerminalWindow title="~/about" class="w-full">
<div class="mb-6 px-4">
@@ -53,20 +57,20 @@ const ownerInitial = siteSettings.ownerName.charAt(0) || 'T';
<i class="fas fa-user-circle"></i>
</span>
<div>
<h1 class="text-2xl font-bold text-[var(--title-color)]">关于我</h1>
<h1 class="text-2xl font-bold text-[var(--title-color)]">{t('about.title')}</h1>
<p class="mt-2 max-w-2xl text-sm leading-6 text-[var(--text-secondary)]">
这里汇总站点主人、技术栈、系统状态和联系方式,现在整体语言会更接近首页与评价页。
{t('about.intro')}
</p>
</div>
</div>
<div class="mt-5 flex flex-wrap gap-2">
<span class="terminal-stat-pill">
<i class="fas fa-location-dot text-[var(--primary)]"></i>
<span>{siteSettings.location || 'Unknown'}</span>
<span>{siteSettings.location || t('common.unknown')}</span>
</span>
<span class="terminal-stat-pill">
<i class="fas fa-layer-group text-[var(--primary)]"></i>
<span>{techStack.length} 项技术栈</span>
<span>{t('about.techStackCount', { count: techStack.length })}</span>
</span>
</div>
</div>
@@ -148,7 +152,7 @@ const ownerInitial = siteSettings.ownerName.charAt(0) || 'T';
layout="grid"
>
<i class="fas fa-envelope text-[var(--text-secondary)]"></i>
<span class="text-sm">Email</span>
<span class="text-sm">{t('comments.email')}</span>
</InfoTile>
)}
<InfoTile
@@ -159,7 +163,7 @@ const ownerInitial = siteSettings.ownerName.charAt(0) || 'T';
rel="noopener noreferrer"
>
<i class="fas fa-globe text-[var(--text-secondary)]"></i>
<span class="text-sm">Website</span>
<span class="text-sm">{t('about.website')}</span>
</InfoTile>
</div>
</div>