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

options does not replace #25

Open
ghost opened this issue Mar 19, 2022 · 2 comments
Open

options does not replace #25

ghost opened this issue Mar 19, 2022 · 2 comments

Comments

@ghost
Copy link

ghost commented Mar 19, 2022

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.

const options = {
      schemaReplacement: {
              from: 'https://sub.url.com/';
              to: '';
          }
  }

This code does not seem to work and the full URL is displayed. How to fix this?

Screenshot 2022-03-19 at 11 19 37 AM

@techexpresslive
Copy link

You need to add localFile query to your opengraphImage in graphql query to resolve this problem.

@opr-inzn
Copy link

opr-inzn commented Apr 2, 2022

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
            }
          }
        }
      }
    }
  `);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants