From a1733921d6db579b338f365359255cf1fb789579 Mon Sep 17 00:00:00 2001 From: QihanNX Date: Tue, 16 Jun 2026 23:23:50 +0800 Subject: [PATCH] Update PostLayout.astro --- src/layouts/PostLayout.astro | 42 +++++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/src/layouts/PostLayout.astro b/src/layouts/PostLayout.astro index 89135bb..30d0e0e 100644 --- a/src/layouts/PostLayout.astro +++ b/src/layouts/PostLayout.astro @@ -14,7 +14,9 @@ type Props = { }; const { site } = config; -const { title, description, ogImage, canonicalURL, pubDatetime, modDatetime } = Astro.props; + +const { title, description, ogImage, canonicalURL, pubDatetime, modDatetime } = + Astro.props; const structuredData = { "@context": "https://schema.org", @@ -23,16 +25,42 @@ const structuredData = { image: ogImage, ...(pubDatetime && { datePublished: pubDatetime.toISOString() }), ...(modDatetime && { dateModified: modDatetime.toISOString() }), - author: [{ "@type": "Person", name: site.author, ...(site.profile && { url: site.profile }) }], + author: [ + { + "@type": "Person", + name: site.author, + ...(site.profile && { url: site.profile }), + }, + ], }; --- - {pubDatetime && } - {modDatetime && } - -
- -
+