diff --git a/src/components/blog/SinglePost.astro b/src/components/blog/SinglePost.astro index 2c889a6..6576b1e 100644 --- a/src/components/blog/SinglePost.astro +++ b/src/components/blog/SinglePost.astro @@ -5,7 +5,7 @@ import SocialShare from '~/components/atoms/SocialShare.astro'; import { getFormattedDate } from '~/utils/utils'; -const { post, canonical } = Astro.props; +const { post, url } = Astro.props; ---
@@ -45,7 +45,7 @@ const { post, canonical } = Astro.props;
diff --git a/src/pages/[...blog]/[slug].astro b/src/pages/[...blog]/[slug].astro index 6e5e0b4..0ff1ab2 100644 --- a/src/pages/[...blog]/[slug].astro +++ b/src/pages/[...blog]/[slug].astro @@ -23,12 +23,12 @@ export async function getStaticPaths() { } const { post } = Astro.props; -const canonical = post.canonical || getCanonical(getPermalink(post.slug, 'post')); +const url = getCanonical(getPermalink(post.slug, 'post')); const meta = { title: `${post.title} — ${SITE.name}`, description: post.description, - canonical: canonical, + canonical: post.canonical || url, image: await findImage(post.image), ogTitle: post.title, ogType: 'article', @@ -36,5 +36,5 @@ const meta = { --- - +