update
Some checks failed
deploy / deploy (push) Has been cancelled

This commit is contained in:
toom1996
2026-08-26 19:42:10 +08:00
parent d64a046f82
commit eee2265e15
29 changed files with 337 additions and 2506 deletions

View File

@ -3,13 +3,13 @@ import Layout from "@/layouts/Layout.astro"
import Article from "@/components/pages/article.astro"
import { getSsrArticle } from "@/lib/api"
// 按需 SSR:服务端按 ?id= 取数并渲染(保留既有 /cn/article?id= 链接,无需改动其他页面)
// 按需 SSR:服务端按 ?id= 取数并渲染(保留既有 /en/article?id= 链接,无需改动其他页面)
export const prerender = false
const id = Astro.url.searchParams.get("id")
const { article, error } = await getSsrArticle(id)
const { article, error } = await getSsrArticle(id, Astro.currentLocale)
---
<Layout>
<Article article={article} locale="cn" error={error} />
<Article article={article} locale="en" error={error} />
</Layout>