mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
55 lines
1.5 KiB
TypeScript
55 lines
1.5 KiB
TypeScript
import React, { ReactElement } from 'react'
|
|
import { Helmet } from 'react-helmet'
|
|
import { useSiteMetadata } from '../../hooks/useSiteMetadata'
|
|
|
|
export default function Seo({
|
|
title,
|
|
description,
|
|
uri
|
|
}: {
|
|
title?: string
|
|
description?: string
|
|
uri: string
|
|
}): ReactElement {
|
|
const { siteTitle, siteTagline, siteUrl, siteImage } = useSiteMetadata()
|
|
|
|
// Remove trailing slash from all URLs
|
|
const canonical = `${siteUrl}${uri}`.replace(/\/$/, '')
|
|
|
|
return (
|
|
<Helmet
|
|
defaultTitle={`${siteTitle} — ${siteTagline}`}
|
|
titleTemplate="%s — Ocean Protocol"
|
|
title={title}
|
|
>
|
|
<html lang="en" />
|
|
|
|
{typeof window !== 'undefined' &&
|
|
window.location &&
|
|
window.location.hostname !== 'oceanprotocol.com' && (
|
|
<meta name="robots" content="noindex,nofollow" />
|
|
)}
|
|
|
|
<link rel="canonical" href={canonical} />
|
|
|
|
<meta name="description" content={description} />
|
|
<meta property="og:title" content={title} />
|
|
<meta property="og:description" content={description} />
|
|
<meta property="og:url" content={uri} />
|
|
|
|
<meta
|
|
name="image"
|
|
content={`${siteUrl}${siteImage.childImageSharp.original.src}`}
|
|
/>
|
|
<meta
|
|
property="og:image"
|
|
content={`${siteUrl}${siteImage.childImageSharp.original.src}`}
|
|
/>
|
|
|
|
<meta property="og:site_name" content={siteTitle} />
|
|
<meta name="twitter:creator" content="@oceanprotocol" />
|
|
<meta name="twitter:card" content="summary_large_image" />
|
|
</Helmet>
|
|
)
|
|
}
|