feat(v2): add canonical URL to <head> (#2694)

This commit is contained in:
Jimmy 2020-05-13 05:29:38 +02:00 committed by GitHub
parent 7d8aeacf52
commit aac4e27a90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View file

@ -100,6 +100,7 @@ function DocItem(props) {
<meta name="twitter:image:alt" content={`Image for ${title}`} />
)}
{permalink && <meta property="og:url" content={siteUrl + permalink} />}
{permalink && <link rel="canonical" href={siteUrl + permalink} />}
</Head>
<div
className={classnames(

View file

@ -75,6 +75,7 @@ function Layout(props) {
{permalink && (
<meta property="og:url" content={siteUrl + permalink} />
)}
{permalink && <link rel="canonical" href={siteUrl + permalink} />}
<meta name="twitter:card" content="summary_large_image" />
</Head>
<AnnouncementBar />