seo test v3

This commit is contained in:
Kalle (Sendou) 2020-12-14 11:26:33 +02:00
parent 105cbfc989
commit f7cc9ee7d0
3 changed files with 28 additions and 18 deletions

View File

@ -1,4 +1,4 @@
import Head from "next/head";
import { NextSeo } from "next-seo";
import { useRouter } from "next/router";
interface Props {
@ -20,23 +20,27 @@ const SEO: React.FC<Props> = ({
const url = "https://sendou.ink" + router.pathname;
return (
<Head>
<title>{fullTitle}</title>
<meta name="title" content={fullTitle} />
<meta name="description" content={description} />
<meta property="og:type" content="website" />
<meta property="og:url" content={url} />
<meta property="og:title" content={fullTitle} />
<meta property="og:description" content={description} />
<meta property="og:image" content={imageSrc} />
<meta property="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content={url} />
<meta property="twitter:title" content={fullTitle} />
<meta property="twitter:description" content={description} />
<meta property="twitter:image" content={imageSrc} />
</Head>
<NextSeo
title={fullTitle}
description={description}
openGraph={{
url,
title,
description,
images: [
{
url: imageSrc,
width: 1200,
height: 628,
},
],
site_name: "sendou.ink",
}}
twitter={{
site: "@sendouink",
cardType: "summary_large_image",
}}
/>
);
};

5
package-lock.json generated
View File

@ -7170,6 +7170,11 @@
"url-loader": "^4.0.0"
}
},
"next-seo": {
"version": "4.17.0",
"resolved": "https://registry.npmjs.org/next-seo/-/next-seo-4.17.0.tgz",
"integrity": "sha512-/hnb3oq7bhi8s7bup7+Lm6VzzgRucj+JrWtp+dJiYs/04H0N/NhmE9MpepixQ16fFj6G/39JLYxhzsO/QZG/Kw=="
},
"next-tick": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz",

View File

@ -38,6 +38,7 @@
"next-auth": "^3.1.0",
"next-google-fonts": "^1.2.1",
"next-images": "^1.6.2",
"next-seo": "^4.17.0",
"nprogress": "^0.2.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",