Skip to content

Instantly share code, notes, and snippets.

@geotrev
Created February 20, 2019 23:59
Show Gist options
  • Save geotrev/57a93f4e1f3c7f48c7d75ce0cb5284f8 to your computer and use it in GitHub Desktop.
Save geotrev/57a93f4e1f3c7f48c7d75ce0cb5284f8 to your computer and use it in GitHub Desktop.
import React from "react"
import { Helmet } from "react-helmet"
import PropTypes from "prop-types"
export default function SetMeta({ title, description }) => (
<Helmet titleTemplate="My Site | %s">
<title itemProp="name" lang="en">{title}</title>
<meta name="description" content={description} />
</Helmet>
)
SetMeta.propTypes = {
title: PropTypes.string.isRequired,
description: PropTypes.string.isRequired,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment