mirror of
https://github.com/Hmbown/DeepSeek-TUI.git
synced 2026-09-03 06:50:13 +08:00
The public FAQ now emits FAQPage JSON-LD from the same 40 Q&A pairs the page renders. The locale layout carries a stable Organization/WebSite graph so SoftwareApplication can reference it. /llms.txt is generated from the docs registry; robots allows it; middleware does not locale-prefix it. Docs pages get a Home → Docs → topic trail and a matching BreadcrumbList. Cloudflare Images is not enabled. Verified: 92 vitest files in the touched web surface passed in the implementing session.
36 lines
741 B
TypeScript
36 lines
741 B
TypeScript
import { flattenExtractedText } from "./react-text";
|
|
|
|
export interface FaqSchemaItem {
|
|
q: string;
|
|
a: React.ReactNode;
|
|
}
|
|
|
|
/**
|
|
* FAQPage structured data from the same Q&A pairs the FAQ page renders.
|
|
* `url` must be the canonical FAQ URL (en or zh), not a partial-locale fallback.
|
|
*/
|
|
export function buildFaqPageJsonLd({
|
|
items,
|
|
url,
|
|
inLanguage,
|
|
}: {
|
|
items: readonly FaqSchemaItem[];
|
|
url: string;
|
|
inLanguage: string;
|
|
}) {
|
|
return {
|
|
"@context": "https://schema.org",
|
|
"@type": "FAQPage",
|
|
url,
|
|
inLanguage,
|
|
mainEntity: items.map((item) => ({
|
|
"@type": "Question",
|
|
name: item.q,
|
|
acceptedAnswer: {
|
|
"@type": "Answer",
|
|
text: flattenExtractedText(item.a),
|
|
},
|
|
})),
|
|
};
|
|
}
|