From f0c22e3583d56e3890e569646467f151c4410b76 Mon Sep 17 00:00:00 2001 From: alxshelepenok Date: Thu, 10 Sep 2020 00:53:50 +0300 Subject: [PATCH] bugfix/#741 - fix socialImageUrl --- src/components/Layout/Layout.js | 2 +- src/templates/page-template.js | 2 +- src/templates/post-template.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Layout/Layout.js b/src/components/Layout/Layout.js index e1cf2a8..d54528f 100644 --- a/src/components/Layout/Layout.js +++ b/src/components/Layout/Layout.js @@ -19,7 +19,7 @@ const Layout = ({ socialImage }: Props) => { const { author, url } = useSiteMetadata(); - const metaImage = socialImage != null ? socialImage : author.photo; + const metaImage = socialImage !== null ? socialImage : author.photo; const metaImageUrl = url + metaImage; return ( diff --git a/src/templates/page-template.js b/src/templates/page-template.js index 1511d97..335ec03 100644 --- a/src/templates/page-template.js +++ b/src/templates/page-template.js @@ -19,7 +19,7 @@ const PageTemplate = ({ data }: Props) => { const { frontmatter } = data.markdownRemark; const { title: pageTitle, description: pageDescription, socialImage } = frontmatter; const metaDescription = pageDescription !== null ? pageDescription : siteSubtitle; - const socialImageUrl = socialImage ? socialImage['publicURL'] : ''; + const socialImageUrl = socialImage ? socialImage['publicURL'] : null; return ( diff --git a/src/templates/post-template.js b/src/templates/post-template.js index d7c4b63..e81a77b 100644 --- a/src/templates/post-template.js +++ b/src/templates/post-template.js @@ -17,7 +17,7 @@ const PostTemplate = ({ data }: Props) => { const { frontmatter } = data.markdownRemark; const { title: postTitle, description: postDescription, socialImage } = frontmatter; const metaDescription = postDescription !== null ? postDescription : siteSubtitle; - const socialImageUrl = socialImage ? socialImage['publicURL'] : ''; + const socialImageUrl = socialImage ? socialImage['publicURL'] : null; return (