Skip to content

Commit

Permalink
Update open-graph.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
luciobenini committed May 28, 2022
1 parent 183ffe5 commit 7d10b32
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/components/open-graph.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useContext } from "react"
import React, { Fragment, useContext } from "react"
import PropTypes from "prop-types"
import { Helmet } from "react-helmet-async"
import { formatLocale, joinLocale, withUrl } from "@pittica/gatsby-plugin-utils"
Expand Down Expand Up @@ -43,11 +43,20 @@ export default function OpenGraph({
/>
)}
{image && (
<meta
property="og:image"
content={withUrl(image, siteUrl)}
key="og-image"
/>
<Fragment>
<meta
property="og:image"
content={withUrl(image, siteUrl)}
key="og-image"
/>
{description && (
<meta
name="og:image:alt"
content={description}
key="og-image-alternative"
/>
)}
</Fragment>
)}
{site && (
<meta property="og:site_name" content={site} key="og-site-name" />
Expand Down

0 comments on commit 7d10b32

Please sign in to comment.