Skip to content

Instantly share code, notes, and snippets.

@adamjarling
Last active August 27, 2020 20:24
Show Gist options
  • Save adamjarling/1217207158f504b3cdcfc7d29576e546 to your computer and use it in GitHub Desktop.
Save adamjarling/1217207158f504b3cdcfc7d29576e546 to your computer and use it in GitHub Desktop.
Example configuration for including
// Very simplified version of a component
import React from "react"
import { Helmet } from "react-helmet"
import { useStaticQuery, graphql } from "gatsby"
import ogImage from "../images/og-image.png"
export default function SEO() {
return (
<Helmet
title="I am a page title"
meta={[
{
property: `og:title`,
content: "I am a title Open Graph protocol will pick up and display",
},
{
property: `og:type`,
content: `website`,
},
{
property: `og:image`,
// You should ideally replace the hardcoded URL below with a value you set
// in your gatsby-config.js file. And import all shared site metadata into
// this component with the useStaticQuery hook.
content: `https://www.furbaby.rocks/${ogImage}`,
},
]}
/>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment