From fbc6a92c96cdfbc6a4cb01f43f92ec370cc874ce Mon Sep 17 00:00:00 2001 From: prototypa Date: Fri, 26 Aug 2022 18:14:00 -0400 Subject: [PATCH] Use canonical in posts in case you define --- src/pages/blog/[slug].astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/blog/[slug].astro b/src/pages/blog/[slug].astro index dc11ad1..51fef5c 100644 --- a/src/pages/blog/[slug].astro +++ b/src/pages/blog/[slug].astro @@ -19,7 +19,7 @@ const { post } = Astro.props; const title = `${post.title} — ${SITE.name}`; const description = post.description; -const canonical = new URL(`blog/${post.slug}`, Astro.site); +const canonical = post.canonical || new URL(`blog/${post.slug}`, Astro.site); const image = await findImage(post.image); ---