Files
frontend_v2/src/pages/cn/article.astro
toom1996 eee2265e15
Some checks failed
deploy / deploy (push) Has been cancelled
update
2026-08-26 19:42:10 +08:00

16 lines
494 B
Plaintext
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.

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