Add files via upload

This commit is contained in:
2024-07-17 14:41:27 +05:00
committed by GitHub
parent 3fef1624db
commit 0cb207bd7c
60 changed files with 2325 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
import { FC } from 'react';
import Head from 'next/head';
type Tags = Array<string> ;
type SeoHeadProps = {
tabTitle: string;
title: string;
canonical?: string;
ogUrl?: string
description: string;
keywords?: string;
imageSource?: string;
videoTags?: Tags;
bookTags?: Tags;
};
const getTags = (tagName: 'video' | 'book', tags?: Tags) => tags && tags.length && tags.map((tag, i) => <meta
key={`${tag}-${i}`}
content={tag}
property={`${tagName}:tag`}
/>);
const SeoHead: FC<SeoHeadProps> = ({
tabTitle,
title,
canonical,
ogUrl,
description,
keywords,
imageSource,
videoTags,
bookTags,
}) => (<Head>
<title>{tabTitle}</title>
<meta content={title} property="og:title" />
<meta content={title} property="twitter:title" />
<meta content={description} name="og:description" />
<meta content={description} name="twitter:description" />
<meta content={description} name="description" />
{canonical && <link rel="canonical" href={canonical} />}
{ogUrl && <meta content={ogUrl} property="og:url" />}
{getTags('video', videoTags)}
{getTags('book', bookTags)}
{imageSource && <meta content={imageSource} property="og:image"/>}
{imageSource && <meta content={imageSource} property="twitter:image"/>}
{keywords && <meta content={keywords} name="Keywords" />}
</Head>);
export default SeoHead;

View File

@@ -0,0 +1 @@
export { default } from './SeoHead';