diff --git a/src/layouts/PostLayout.astro b/src/layouts/PostLayout.astro index 3735ca8..556b853 100644 --- a/src/layouts/PostLayout.astro +++ b/src/layouts/PostLayout.astro @@ -13,51 +13,27 @@ type Props = { }; const { site } = config; - const { title, description, ogImage, canonicalURL, pubDatetime, modDatetime } = Astro.props; const commentPath = Astro.url.pathname; -const structuredData = { - "@context": "https://schema.org", - "@type": "BlogPosting", - headline: title ?? site.title, - image: ogImage, - ...(pubDatetime && { datePublished: pubDatetime.toISOString() }), - ...(modDatetime && { dateModified: modDatetime.toISOString() }), - author: [ - { - "@type": "Person", - name: site.author, - ...(site.profile && { url: site.profile }), - }, - ], -}; +const structuredData = { /* 保持不变 */ }; --- - { - pubDatetime && ( - - ) - } - { - modDatetime && ( - - ) - } + {pubDatetime && } + {modDatetime && }