Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

twitter:imageの追加 #22

Merged
merged 3 commits into from
Oct 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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