diff --git a/website/src/components/seo.js b/website/src/components/seo.js index 9aaee43fe..5e121195e 100644 --- a/website/src/components/seo.js +++ b/website/src/components/seo.js @@ -6,6 +6,7 @@ import { StaticQuery, graphql } from 'gatsby' import socialImageDefault from '../images/social_default.jpg' import socialImageApi from '../images/social_api.jpg' import socialImageUniverse from '../images/social_universe.jpg' +import socialImageNightly from '../images/social_nightly.jpg' function getPageTitle(title, sitename, slogan, sectionTitle) { if (sectionTitle && title) { @@ -17,13 +18,14 @@ function getPageTitle(title, sitename, slogan, sectionTitle) { return `${sitename} ยท ${slogan}` } -function getImage(section) { +function getImage(section, nightly) { + if (nightly) return socialImageNightly if (section === 'api') return socialImageApi if (section === 'universe') return socialImageUniverse return socialImageDefault } -const SEO = ({ description, lang, title, section, sectionTitle, bodyClass }) => ( +const SEO = ({ description, lang, title, section, sectionTitle, bodyClass, nightly }) => ( { @@ -35,7 +37,7 @@ const SEO = ({ description, lang, title, section, sectionTitle, bodyClass }) => siteMetadata.slogan, sectionTitle ) - const socialImage = siteMetadata.siteUrl + getImage(section) + const socialImage = siteMetadata.siteUrl + getImage(section, nightly) const meta = [ { name: 'description', diff --git a/website/src/images/social_nightly.jpg b/website/src/images/social_nightly.jpg new file mode 100644 index 000000000..f7087fb54 Binary files /dev/null and b/website/src/images/social_nightly.jpg differ diff --git a/website/src/templates/index.js b/website/src/templates/index.js index 650393426..b40f03fee 100644 --- a/website/src/templates/index.js +++ b/website/src/templates/index.js @@ -162,6 +162,7 @@ class Layout extends React.Component { section={section} sectionTitle={sectionTitle} bodyClass={bodyClass} + nightly={meta.nightly} />