Skip to content

Commit 56c5696

Browse files
authored
Merge pull request #573 from Stefterv/og-banner
Added opengraph default image
2 parents 3c2a566 + a39fb21 commit 56c5696

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/components/HeadMatter.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ export const HeadMatter = ({
2222
imgUrl = /^http/.test(imgSrc) ? imgSrc : 'https://processing.org/' + imgSrc;
2323
}
2424

25+
imgUrl = imgUrl || '/img/banner.png';
26+
2527
const pageUrl = 'https://processing.org/' + location.pathname;
2628
return (
2729
<Helmet>
@@ -43,7 +45,7 @@ export const HeadMatter = ({
4345
<meta property="og:type" content={ogType || 'website'} />
4446
<meta property="og:title" content={title} />
4547
<meta property="og:description" content={shortDescription} />
46-
{img && <meta property="og:image" content={imgUrl} />}
48+
{imgUrl && <meta property="og:image" content={imgUrl} />}
4749
</Helmet>
4850
);
4951
};

static/img/banner.png

296 KB
Loading

0 commit comments

Comments
 (0)