2022-05-16 14:25:22 +02:00
|
|
|
import Head from 'next/head'
|
|
|
|
import useTranslation from 'next-translate/useTranslation'
|
2022-03-24 15:00:14 +01:00
|
|
|
|
2022-04-12 16:47:21 +02:00
|
|
|
import { projectConfig } from 'utils/config'
|
2022-03-24 15:00:14 +01:00
|
|
|
|
2022-05-16 14:25:22 +02:00
|
|
|
interface HeadProps {
|
|
|
|
title?: string
|
|
|
|
}
|
|
|
|
|
|
|
|
const NextHead: React.FC<HeadProps> = (props) => {
|
|
|
|
const { title = projectConfig.shortName } = props
|
|
|
|
|
|
|
|
const { lang } = useTranslation()
|
|
|
|
|
2022-03-24 15:00:14 +01:00
|
|
|
return (
|
|
|
|
<Head>
|
2022-05-16 14:25:22 +02:00
|
|
|
<title>{title}</title>
|
2022-03-24 15:00:14 +01:00
|
|
|
|
|
|
|
<link
|
|
|
|
rel='shortcut icon'
|
|
|
|
href={projectConfig.icons.default}
|
|
|
|
type='image/x-icon'
|
|
|
|
/>
|
|
|
|
<link
|
|
|
|
rel='apple-touch-icon'
|
|
|
|
sizes='180x180'
|
|
|
|
href={projectConfig.icons.apple}
|
|
|
|
/>
|
|
|
|
<link
|
|
|
|
rel='icon'
|
|
|
|
type='image/png'
|
|
|
|
sizes='16x16'
|
|
|
|
href={projectConfig.icons['16_16']}
|
|
|
|
/>
|
|
|
|
<link
|
|
|
|
rel='icon'
|
|
|
|
type='image/png'
|
|
|
|
sizes='32x32'
|
|
|
|
href={projectConfig.icons['32_32']}
|
|
|
|
/>
|
|
|
|
|
|
|
|
{/* Default meta tags */}
|
|
|
|
|
2022-05-16 14:25:22 +02:00
|
|
|
<meta name='viewport' content='width=device-width, initial-scale=1.0' />
|
2022-03-24 15:00:14 +01:00
|
|
|
<meta name='description' content={projectConfig.description} />
|
2022-05-16 14:25:22 +02:00
|
|
|
<meta name='language' content={lang} />
|
2022-03-24 15:00:14 +01:00
|
|
|
<meta name='theme-color' content={projectConfig.color} />
|
|
|
|
<meta name='copyright' content={projectConfig.shortName} />
|
|
|
|
<meta name='author' content={projectConfig.shortName} />
|
|
|
|
<meta name='publisher' content={projectConfig.shortName} />
|
|
|
|
<meta name='robots' content='index, follow' />
|
|
|
|
<meta name='rating' content='general' />
|
|
|
|
<meta name='distribution' content='global' />
|
|
|
|
<meta name='msapplication-TileColor' content={projectConfig.color} />
|
|
|
|
|
|
|
|
{/* Open graph MT */}
|
|
|
|
|
|
|
|
<meta property='og:title' content={projectConfig.shortName} />
|
|
|
|
<meta property='og:type' content='website' />
|
|
|
|
<meta property='og:url' content={projectConfig.url} />
|
|
|
|
<meta property='og:image' content={projectConfig.icons.image} />
|
|
|
|
<meta property='og:description' content={projectConfig.description} />
|
2022-05-16 14:25:22 +02:00
|
|
|
<meta
|
|
|
|
property='og:locale'
|
|
|
|
content={`${lang as string}_${lang.toUpperCase() as string}`}
|
|
|
|
/>
|
2022-03-24 15:00:14 +01:00
|
|
|
<meta property='og:site_name' content={projectConfig.longName} />
|
|
|
|
|
|
|
|
{/* Twitter card Metadata */}
|
|
|
|
<meta name='twitter:card' content='summary' />
|
|
|
|
<meta name='twitter:description' content={projectConfig.description} />
|
|
|
|
<meta name='twitter:title' content={projectConfig.longName} />
|
|
|
|
<meta name='twitter:image:src' content={projectConfig.icons.image} />
|
|
|
|
</Head>
|
|
|
|
)
|
|
|
|
}
|
2022-05-16 14:25:22 +02:00
|
|
|
|
|
|
|
export default NextHead
|