forked from tdjsnelling/sqtracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSEO.js
More file actions
28 lines (24 loc) · 772 Bytes
/
Copy pathSEO.js
File metadata and controls
28 lines (24 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import React from "react";
import Head from "next/head";
import getConfig from "next/config";
const SEO = ({ title, noTitleTemplate }) => {
const {
publicRuntimeConfig: { SQ_SITE_NAME, SQ_SITE_DESCRIPTION },
} = getConfig();
const formattedTitle = title
? noTitleTemplate
? title
: `${title} — ${SQ_SITE_NAME}`
: SQ_SITE_NAME;
return (
<Head>
<title>{formattedTitle}</title>
<meta property="og:title" content={formattedTitle} />
<meta name="description" content={SQ_SITE_DESCRIPTION} />
<meta property="og:description" content={SQ_SITE_DESCRIPTION} />
<meta property="og:site_name" content={SQ_SITE_NAME} />
<meta property="og:type" content="website" />
</Head>
);
};
export default SEO;