Open ghost opened 2 years ago
You need to add localFile query to your opengraphImage in graphql query to resolve this problem.
Hey @techexpresslive thanks for your reply! Where shall I add this in my query:
const {
wp: { seo },
} = useStaticQuery(graphql`
query SiteInfoQuery {
wp {
seo {
contentTypes {
post {
title
schemaType
metaRobotsNoindex
metaDesc
}
page {
metaDesc
metaRobotsNoindex
schemaType
title
}
}
webmaster {
googleVerify
yandexVerify
msVerify
baiduVerify
}
schema {
companyName
personName
companyOrPerson
wordpressSiteName
siteUrl
siteName
inLanguage
logo {
sourceUrl
mediaItemUrl
altText
}
}
social {
facebook {
url
defaultImage {
sourceUrl
mediaItemUrl
}
}
instagram {
url
}
linkedIn {
url
}
mySpace {
url
}
pinterest {
url
metaTag
}
twitter {
username
}
wikipedia {
url
}
youTube {
url
}
}
}
}
}
`);
I would like to replace the URL of my og:image and place it in the Gatsby static folder. Right now, it is loaded (and worse: displayed) with the full URL of my backend, that I'd like to hide.
This code does not seem to work and the full URL is displayed. How to fix this?