--- import Layout from "./Layout.astro"; import config from "@/config"; import TwikooComments from "../components/TwikooComments.astro"; type Props = { title?: string; description?: string; ogImage?: string; canonicalURL?: string; pubDatetime?: Date; modDatetime?: Date | null; }; const { site } = config; const { title, description, ogImage, canonicalURL, pubDatetime, modDatetime } = Astro.props; const commentPath = Astro.url.pathname; // 结构化数据(保持你原来的实现,此处仅作示例) const structuredData = { "@context": "https://schema.org", "@type": "Article", headline: title, description: description, // ... 其他字段按你的原有逻辑填充 }; --- {pubDatetime && ( )} {modDatetime && ( )}