Skip to content

Commit

Permalink
fix(www): Add og:url meta property to fix LinkedIn shares (gatsbyjs#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
Jared-Dev authored and sidharthachatterjee committed May 18, 2019
1 parent 649f6d8 commit 921bde9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions www/src/templates/template-blog-post.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@ const renderAst = new rehypeReact({

class BlogPostTemplate extends React.Component {
render() {
const post = this.props.data.markdownRemark
const prev = this.props.pageContext.prev
const next = this.props.pageContext.next
const {
pageContext: { prev, next },
data: { markdownRemark: post },
location: { href },
} = this.props
const prevNextLinkStyles = {
"&&": {
borderBottom: 0,
Expand Down Expand Up @@ -73,7 +75,6 @@ class BlogPostTemplate extends React.Component {
<link rel="canonical" href={post.frontmatter.canonicalLink} />
)
}

return (
<Layout location={this.props.location}>
<Container>
Expand Down Expand Up @@ -109,6 +110,7 @@ class BlogPostTemplate extends React.Component {
<meta property="og:description" content={post.excerpt} />
<meta name="twitter:description" content={post.excerpt} />
<meta property="og:title" content={post.frontmatter.title} />
<meta property="og:url" content={href} />
{post.frontmatter.image && (
<meta
property="og:image"
Expand Down

0 comments on commit 921bde9

Please sign in to comment.