Skip to content

Commit 04bfbee

Browse files
committed
✨ feat: add canonical URL
1 parent b3d508d commit 04bfbee

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/layouts/Layout.astro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export interface Props {
99
}
1010
1111
const { SEO_LANG, SEO_LOCALE, SEO_TITLE, SEO_DESCRIPTION } = Astro.props;
12+
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
1213
---
1314

1415
<!doctype html>
@@ -49,6 +50,7 @@ const { SEO_LANG, SEO_LOCALE, SEO_TITLE, SEO_DESCRIPTION } = Astro.props;
4950
/>
5051
<link rel="sitemap" href="/sitemap-index.xml" />
5152
<meta name="generator" content={Astro.generator} />
53+
<link rel="canonical" href={canonicalURL} />
5254
<title>{SEO_TITLE}</title>
5355
</head>
5456
<link rel="stylesheet"

0 commit comments

Comments
 (0)