import React, { PureComponent } from 'react'
import Helmet from 'react-helmet'
import PropTypes from 'prop-types'
import { StaticQuery, graphql } from 'gatsby'
const query = graphql`
query {
contentYaml {
title
tagline
description
url
img {
childImageSharp {
resize(width: 980) {
src
}
}
}
social {
Twitter
}
gpg
addressbook
}
}
`
const MetaTags = ({ title, description, url, image, meta }) => {
return (
{/* General tags */}
{/* OpenGraph tags */}
{/* Twitter Card tags */}
)
}
MetaTags.propTypes = {
title: PropTypes.string,
description: PropTypes.string,
url: PropTypes.string,
image: PropTypes.string,
meta: PropTypes.object
}
export default class SEO extends PureComponent {
static propTypes = {
project: PropTypes.object
}
render() {
return (
{
const { project } = this.props
const meta = data.contentYaml
const title = (project && project.title) || null
const description =
(project && project.fields.excerpt) || meta.description
const image =
(project && project.img.childImageSharp.twitterImage.src) ||
meta.img.childImageSharp.resize.src
const url = (project && `${meta.url}${project.slug}`) || meta.url
return (
)
}}
/>
)
}
}