Add canonical URL to blog example (#5651)
This commit is contained in:
parent
0b50987584
commit
46757a6ce3
1 changed files with 5 additions and 0 deletions
|
@ -9,6 +9,8 @@ export interface Props {
|
||||||
image?: string;
|
image?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const canonicalURL = new URL(Astro.url.pathname, Astro.site);
|
||||||
|
|
||||||
const { title, description, image = '/placeholder-social.jpg' } = Astro.props;
|
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" />
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||||
<meta name="generator" content={Astro.generator} />
|
<meta name="generator" content={Astro.generator} />
|
||||||
|
|
||||||
|
<!-- Canonical URL -->
|
||||||
|
<link rel="canonical" href={canonicalURL} />
|
||||||
|
|
||||||
<!-- Primary Meta Tags -->
|
<!-- Primary Meta Tags -->
|
||||||
<title>{title}</title>
|
<title>{title}</title>
|
||||||
<meta name="title" content={title} />
|
<meta name="title" content={title} />
|
||||||
|
|
Loading…
Reference in a new issue