summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--examples/blog/src/components/BaseHead.astro5
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/blog/src/components/BaseHead.astro b/examples/blog/src/components/BaseHead.astro
index ce60a7e77..371f6bd85 100644
--- a/examples/blog/src/components/BaseHead.astro
+++ b/examples/blog/src/components/BaseHead.astro
@@ -9,6 +9,8 @@ export interface Props {
image?: string;
}
+const canonicalURL = new URL(Astro.url.pathname, Astro.site);
+
const { title, description, image = '/placeholder-social.jpg' } = Astro.props;
---
@@ -18,6 +20,9 @@ const { title, description, image = '/placeholder-social.jpg' } = Astro.props;
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="generator" content={Astro.generator} />
+<!-- Canonical URL -->
+<link rel="canonical" href={canonicalURL} />
+
<!-- Primary Meta Tags -->
<title>{title}</title>
<meta name="title" content={title} />