Skip to content

Instantly share code, notes, and snippets.

@sudarshang
Created May 2, 2018 12:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sudarshang/4576fbd351b5f0751b4178c015d47942 to your computer and use it in GitHub Desktop.
Save sudarshang/4576fbd351b5f0751b4178c015d47942 to your computer and use it in GitHub Desktop.
A component for Meta tags in react-static
'use strict';
import React from 'react'
import { Head } from 'react-static'
const Meta = (props) => (
<Head>
<title>{props.title ? `${props.title} - ` : ""}My Site</title>
<meta itemProp="name" content={props.title ? props.title : "My Site Title"}/>
<meta itemProp="description" content={props.description ? props.description : "My Site Description"}/>
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:site" content="@ozburo"/>
<meta name="twitter:title" content={props.title ? props.title : "My Site"}/>
<meta name="twitter:creator" content="@ozburo"/>
<meta name="twitter:description" content={props.description ? props.description : "My Site Description"}/>
<meta name="twitter:image" content={props.image_url ? props.image_url : "https://mysite.com/img/image.png"}/>
</Head>
)
export default Meta;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment