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 {
1111}
1212const { title, meta } = Astro .props ;
1313const faviconUrl = readPublicAsset (' favicon.svg' );
14+ const canonicalUrl = Astro .site ? new URL (Astro .url .pathname , Astro .site ).toString () : null ;
1415---
1516
1617<!doctype html >
@@ -20,6 +21,7 @@ const faviconUrl = readPublicAsset('favicon.svg');
2021 <title slot =" title" >{ title } </title >
2122
2223 <Fragment slot =" links" >
24+ { canonicalUrl && <link rel = " canonical" href = { canonicalUrl } />}
2325 { faviconUrl ? <link rel = " icon" type = " image/svg+xml" href = { faviconUrl } /> : null }
2426 <link rel =" preconnect" href =" https://fonts.googleapis.com" />
2527 <link rel =" preconnect" href =" https://fonts.gstatic.com" crossorigin />
You can’t perform that action at this time.
0 commit comments