From 8dc100fdee5025034da89ae045ae9a2e65f3f237 Mon Sep 17 00:00:00 2001 From: QihanNX Date: Tue, 16 Jun 2026 22:32:28 +0800 Subject: [PATCH] Update PostLayout.astro --- src/layouts/PostLayout.astro | 59 +++++++++++++++--------------------- 1 file changed, 25 insertions(+), 34 deletions(-) diff --git a/src/layouts/PostLayout.astro b/src/layouts/PostLayout.astro index 9903dfe..74e93d7 100644 --- a/src/layouts/PostLayout.astro +++ b/src/layouts/PostLayout.astro @@ -13,9 +13,7 @@ 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", @@ -24,49 +22,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 && ( - - ) - } -