Skip to content

Commit

Permalink
Merge pull request #22 from ffjlabo/dev/20_set_meta_twitter_image
Browse files Browse the repository at this point in the history
twitter:imageの追加
  • Loading branch information
ffjlabo authored Oct 11, 2020
2 parents 418c123 + 0b1b7d8 commit 973e901
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
10 changes: 10 additions & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
let baseUrl = process.env["DEPLOY_PRIME_URL"]
if (process.env["CONTEXT"] === "production") {
baseUrl = process.env["URL"]
}

if (baseUrl === undefined) {
baseUrl = ""
}

module.exports = {
siteMetadata: {
title: `ふじを録`,
description: `日々の備忘録です`,
author: `@ffjlabo`,
baseURL: baseUrl,
},
plugins: [
`gatsby-plugin-styled-components`,
Expand Down
7 changes: 6 additions & 1 deletion src/components/seo.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ function SEO({ description, lang, meta, keywords, title }) {
title
description
author
baseURL
}
}
}
Expand Down Expand Up @@ -54,7 +55,7 @@ function SEO({ description, lang, meta, keywords, title }) {
},
{
property: `og:image`,
content: ogImage,
content: site.siteMetadata.baseURL + ogImage,
},
{
name: `twitter:card`,
Expand All @@ -72,6 +73,10 @@ function SEO({ description, lang, meta, keywords, title }) {
name: `twitter:description`,
content: metaDescription,
},
{
name: `twitter:image`,
content: site.siteMetadata.baseURL + ogImage,
},
]
.concat(
keywords.length > 0
Expand Down

0 comments on commit 973e901

Please sign in to comment.