File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed
packages/astro/src/default/layouts Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ interface Props {
11
11
}
12
12
const { title, meta } = Astro .props ;
13
13
const faviconUrl = readPublicAsset (' favicon.svg' );
14
+ const canonicalUrl = Astro .site ? new URL (Astro .url .pathname , Astro .site ).toString () : null ;
14
15
---
15
16
16
17
<!doctype html >
@@ -20,6 +21,7 @@ const faviconUrl = readPublicAsset('favicon.svg');
20
21
<title slot =" title" >{ title } </title >
21
22
22
23
<Fragment slot =" links" >
24
+ { canonicalUrl && <link rel = " canonical" href = { canonicalUrl } />}
23
25
{ faviconUrl ? <link rel = " icon" type = " image/svg+xml" href = { faviconUrl } /> : null }
24
26
<link rel =" preconnect" href =" https://fonts.googleapis.com" />
25
27
<link rel =" preconnect" href =" https://fonts.gstatic.com" crossorigin />
You can’t perform that action at this time.
0 commit comments