Skip to content

Commit 5a81f43

Browse files
committed
Add OG image
1 parent 93f4115 commit 5a81f43

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

src/site/_data/netlify.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const PROD_URL = "https://www.jamstack.org";
2+
3+
module.exports = {
4+
/*
5+
See also Netlify ENV variables:
6+
process.env.CONTEXT === "production" ||
7+
process.env.CONTEXT === "deploy-preview" ||
8+
process.env.CONTEXT === "branch-deploy"
9+
10+
via https://docs.netlify.com/configure-builds/environment-variables/
11+
12+
*/
13+
deployUrl: process.env.CONTEXT === "production" ? PROD_URL : process.env.DEPLOY_PRIME_URL
14+
};

src/site/_includes/layouts/base.njk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: Jamstack | JavaScript, APIs, and Markup
33
description: What is the Jamstack? Why use the Jamstack? How do I get started? Learn what the Jamstack is all about and why it's the best approach for building faster, more secure websites.
44
---
5+
56
<!doctype html>
67
<html lang="en">
78
<head>
@@ -18,12 +19,12 @@ description: What is the Jamstack? Why use the Jamstack? How do I get started? L
1819
<meta property="og:url" content="https://jamstack.org/">
1920
<meta property="og:description" content="{{ description }}">
2021
<meta property="og:type" content="website">
21-
<meta property="og:image" content="">
22+
<meta property="og:image" content="{{ netlify.deployUrl }}/img/og/default-og-image.png">
2223
<meta property="twitter:card" content="summary_large_image">
2324
<meta property="twitter:url" content="https://jamstack.org/">
2425
<meta property="twitter:title" content="{{ title }} | Jamstack">
2526
<meta property="twitter:description" content="{{ description }}">
26-
<meta property="twitter:image" content="">
27+
<meta property="twitter:image" content="{{ netlify.deployUrl }}/img/og/default-og-image.png">
2728
</head>
2829
<body class="bg-blue-900 text-blue-100 leading-relaxed antialiased">
2930
<svg width="0" height="0" aria-hidden="true" style="position: absolute;">
172 KB
Loading

0 commit comments

Comments
 (0)