Skip to content

Instantly share code, notes, and snippets.

@BurnedChris
Created March 29, 2021 11:55
Show Gist options
  • Save BurnedChris/809513be6dd144f7c57e20202e17d606 to your computer and use it in GitHub Desktop.
Save BurnedChris/809513be6dd144f7c57e20202e17d606 to your computer and use it in GitHub Desktop.
Redwood SEO tag
import { ReactElement } from 'react'
import { Helmet } from 'react-helmet'
export interface SEOProps {
/**
* If `true`, the button will show a spinner.
*/
title?: string
description?: string
}
const SEO = ({ title, description, image }: SEOProps): ReactElement => {
const siteName = 'Everfund'
const setTitle = `${title} / Everfund.co.uk`
const footer =
'Create, share and track high performance donation links and raise more from donors no matter where they are'
const siteUrl = window.location.origin
const fullSiteUrl = `${siteUrl}/${
window.location.pathname.replace('/', '') || ''
}`
return (
<Helmet>
<title>{setTitle}</title>
<meta name="description" content={description || footer} />
<link rel="canonical" href={fullSiteUrl} />
{/* <link rel="shortcut icon" href={data.favicon.publicURL} /> */}
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@everfunduk" />
<meta name="og:title" content={title} />
<meta name="og:description" content={description || footer} />
<meta
name="og:image"
content={`${siteUrl}/${image || `social-banner.png`}`}
/>
<meta name="og:type" content="website" />
<meta name="og:url" content={fullSiteUrl} />
<meta name="og:site_name" content={siteName} />
<link
rel="apple-touch-icon"
sizes="180x180"
href="/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="/favicon-16x16.png"
/>
<link rel="manifest" href="/site.webmanifest" />
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#e65f66" />
<meta name="apple-mobile-web-app-title" content="Everfund" />
<meta name="application-name" content="Everfund" />
<meta name="msapplication-TileColor" content="#e65f66" />
<meta name="theme-color" content="#ffffff" />
</Helmet>
)
}
export default SEO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment