This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
website/components/Head.tsx

55 lines
1.7 KiB
TypeScript
Raw Normal View History

2021-10-24 05:48:06 +02:00
import NextHead from 'next/head'
2021-10-24 05:19:39 +02:00
import useTranslation from 'next-translate/useTranslation'
interface HeadProps {
title?: string
image?: string
description?: string
url?: string
}
export const Head: React.FC<HeadProps> = (props) => {
const { t } = useTranslation()
const {
title = 'Thream',
image = 'https://thream.divlo.fr/images/icons/128x128.png',
2021-10-24 05:19:39 +02:00
description = t('common:description'),
url = 'https://thream.divlo.fr/'
} = props
return (
2021-10-24 05:48:06 +02:00
<NextHead>
2021-10-24 05:19:39 +02:00
<title>{title}</title>
<link rel='icon' type='image/png' href={image} />
{/* Meta Tag */}
2021-10-24 05:48:06 +02:00
<meta name='viewport' content='width=device-width, initial-scale=1.0' />
2021-10-24 05:19:39 +02:00
<meta name='description' content={description} />
2021-10-24 05:48:06 +02:00
<meta name='Language' content='fr, en' />
2021-10-24 05:19:39 +02:00
<meta name='theme-color' content='#27B05E' />
{/* Open Graph Metadata */}
<meta property='og:title' content={title} />
<meta property='og:type' content='website' />
<meta property='og:url' content={url} />
<meta property='og:image' content={image} />
<meta property='og:description' content={description} />
2021-10-24 05:48:06 +02:00
<meta property='og:locale' content='fr_FR, en_US' />
2021-10-24 05:19:39 +02:00
<meta property='og:site_name' content={title} />
{/* Twitter card Metadata */}
<meta name='twitter:card' content='summary' />
<meta name='twitter:description' content={description} />
<meta name='twitter:title' content={title} />
<meta name='twitter:image' content={image} />
2021-10-24 05:19:39 +02:00
{/* PWA Data */}
<link rel='manifest' href='/manifest.json' />
<meta name='apple-mobile-web-app-capable' content='yes' />
<meta name='mobile-web-app-capable' content='yes' />
<link rel='apple-touch-icon' href={image} />
2021-10-24 05:48:06 +02:00
</NextHead>
2021-10-24 05:19:39 +02:00
)
}