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/") && ( ) }