1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-11-26 19:49:26 +01:00

use custom share image

This commit is contained in:
Matthias Kretschmann 2018-11-22 21:54:34 +01:00
parent aabe28786f
commit 2be32452d8
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 15 additions and 7 deletions

View File

@ -10,10 +10,17 @@ const query = graphql`
siteTitle siteTitle
siteDescription siteDescription
siteUrl siteUrl
siteIcon }
siteCompany }
social {
twitter shareImage: allFile(filter: { name: { eq: "share" } }) {
edges {
node {
childImageSharp {
fixed {
src
}
}
} }
} }
} }
@ -95,7 +102,7 @@ const MetaTags = ({
{/* Twitter Card tags */} {/* Twitter Card tags */}
<meta name="twitter:card" content="summary_large_image" /> <meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:creator" content={siteMeta.social.twitter || ''} /> <meta name="twitter:creator" content="@oceanprotocol" />
<meta name="twitter:title" content={title} /> <meta name="twitter:title" content={title} />
<meta name="twitter:description" content={description} /> <meta name="twitter:description" content={description} />
<meta name="twitter:image" content={image} /> <meta name="twitter:image" content={image} />
@ -117,12 +124,13 @@ const SEO = ({ title, description, slug, article }) => (
query={query} query={query}
render={data => { render={data => {
const siteMeta = data.site.siteMetadata const siteMeta = data.site.siteMetadata
const logo = '/icons/icon-512x512.png' const shareImage =
data.shareImage.edges[0].node.childImageSharp.fixed.src
title = title || siteMeta.siteTitle title = title || siteMeta.siteTitle
description = description || siteMeta.siteDescription description = description || siteMeta.siteDescription
let url = siteMeta.siteUrl || siteMeta.siteUrl + slug let url = siteMeta.siteUrl || siteMeta.siteUrl + slug
let image = siteMeta.siteUrl + logo let image = siteMeta.siteUrl + shareImage
let schema = createSchemaOrg( let schema = createSchemaOrg(
title, title,

BIN
src/images/share.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB