next-app-boilerplate/components/Head.tsx

43 lines
1.4 KiB
TypeScript
Raw Normal View History

import NextHead from 'next/head'
2022-02-12 23:07:11 +01:00
const Head: React.FC = () => {
const data = {
title: process.env.NEXT_PUBLIC_PROJECT_NAME,
description: process.env.NEXT_PUBLIC_PROJECT_DESCRIPTION,
image: '/images/icons/64x64.png',
url: 'https://urlwebsite.fr/'
}
2022-02-12 23:07:11 +01:00
return (
<NextHead>
<title>{data.title}</title>
2022-02-12 23:07:11 +01:00
<link rel='icon' type='image/png' href={data.image} />
<link rel='apple-touch-icon' href={data.image} />
2022-02-12 23:07:11 +01:00
{/* Meta Tag */}
<meta name='viewport' content='width=device-width, initial-scale=1.0' />
<meta name='description' content={data.description} />
<meta name='Language' content='fr, en' />
<meta name='theme-color' content='#27B05E' />
2022-02-12 23:07:11 +01:00
{/* Open Graph Metadata */}
<meta property='og:title' content={data.title} />
<meta property='og:type' content='website' />
<meta property='og:url' content={data.url} />
<meta property='og:image' content={data.image} />
<meta property='og:description' content={data.description} />
<meta property='og:locale' content='en_US' />
<meta property='og:site_name' content={data.title} />
2022-02-12 23:07:11 +01:00
{/* Twitter card Metadata */}
<meta name='twitter:card' content='summary' />
<meta name='twitter:description' content={data.description} />
<meta name='twitter:title' content={data.title} />
<meta name='twitter:image:src' content={data.image} />
2022-02-12 23:07:11 +01:00
</NextHead>
)
}
2022-02-12 23:07:11 +01:00
export default Head