From 497688ecbf9f73490ee1accd084f9cce5bea632d Mon Sep 17 00:00:00 2001 From: QihanNX Date: Mon, 15 Jun 2026 23:30:56 +0800 Subject: [PATCH] Update PostLayout.astro --- src/layouts/PostLayout.astro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/layouts/PostLayout.astro b/src/layouts/PostLayout.astro index f5c2f5a..8a1b7f4 100644 --- a/src/layouts/PostLayout.astro +++ b/src/layouts/PostLayout.astro @@ -16,7 +16,7 @@ const { site } = config; const { title, description, ogImage, canonicalURL, pubDatetime, modDatetime } = Astro.props; -const commentPath = canonicalURL ? new URL(canonicalURL).pathname : undefined; +const commentPath = Astro.url.pathname; const structuredData = { "@context": "https://schema.org", @@ -54,7 +54,7 @@ const structuredData = { { - commentPath && ( + commentPath.startsWith("/posts/") && ( ) }