Files
arcticnewone/app/app.vue
T
virtheart 5c3f3bca63 feat: 全量落地后端与功能闭环
- 真实后端(server/):SQLite 存储 + scrypt 会话鉴权 + SMTP 邮件
  - auth 注册/登录/登出/me/资料更新
  - contact 联系表单(落库+邮件)、newsletter 订阅(去重)
  - favorites 作品收藏、comments 新闻评论、account 管理收件箱
- 用户系统 UI:个人中心 /account(资料/收藏/评论/管理员面板)、
  收藏按钮、评论组件、登录/注册弹窗接真实 API(useApiError 错误映射)
- 内容单点事实源:app/data/news|work 消除三处重复,页面全部引用
- 修复断链:首页动态/作品卡可点击、分享按钮真实动作、移除 # 死链、
  语言切换器、社交链接统一 siteConfig
- SEO:动态 sitemap/robots、JSON-LD、脚本生成真实 og-image.png
- 列表增强:搜索 + 加载更多
- 部署自动化:build-and-push.sh 支持 git tag 版本化镜像;
  deploy.sh 一条命令构建推送+注入 Secret/ConfigMap+kubectl 滚动升级;
  deployment 挂 PVC 持久化;Dockerfile 支持 better-sqlite3 原生编译
- 组件注册去目录前缀,修复 AppLoader/AnimatedButton 等未渲染问题
2026-08-06 15:08:34 +08:00

56 lines
1.5 KiB
Vue
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
import { useHead, useSeoMeta, useRuntimeConfig } from '#imports'
import { useI18n } from 'vue-i18n'
import { siteConfig } from '~/config/site'
const { t } = useI18n()
const { public: publicCfg } = useRuntimeConfig()
const baseUrl = String(publicCfg.siteUrl || '').replace(/\/$/, '')
// 站点通用基础信息
const siteImage = baseUrl ? `${baseUrl}/og-image.png` : '/og-image.png'
// 配置全局 Title 模板
useHead({
titleTemplate: (titleChunk?: string) => {
const siteName = t('app.name')
return titleChunk ? `${titleChunk} - ${siteName}` : siteName
},
// JSON-LD 结构化数据(Organization)
script: [
{
type: 'application/ld+json',
innerHTML: JSON.stringify({
'@context': 'https://schema.org',
'@type': 'Organization',
name: t('app.name'),
alternateName: siteConfig.brandZh,
description: t('app.description'),
url: baseUrl || undefined,
logo: siteImage,
sameAs: siteConfig.socials.map((s) => s.url),
}),
},
],
})
// 配置全局基础 SEO 和 Meta (响应式支持国际化)
useSeoMeta({
description: () => t('app.description'),
ogTitle: () => t('app.name'),
ogDescription: () => t('app.description'),
ogImage: siteImage,
ogType: 'website',
twitterCard: 'summary_large_image',
twitterTitle: () => t('app.name'),
twitterDescription: () => t('app.description'),
twitterImage: siteImage,
})
</script>
<template>
<NuxtLayout>
<NuxtPage />
</NuxtLayout>
</template>