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 returns error #24

Open
ghost opened this issue Mar 4, 2022 · 0 comments
Open

options returns error #24

ghost opened this issue Mar 4, 2022 · 0 comments

Comments

@ghost
Copy link

ghost commented Mar 4, 2022

I would like to replace part of the url of my opengraph image, but get an error.

const Layout = (props) => {
  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
            }
          }
        }
      }
    }
  `);
  const options = {
      schemaReplacement: {
              from: 'https://sub.url.com/';
              to: 'https://url.com/';
          }
  }
  return (
    <SEOContext.Provider value={{ global: seo, options }}>
      <div className={props.class}>
        <Header />
        <div>
          {props.children}
          <Footer />
        </div>
      </div>
    </SEOContext.Provider>
  );
};

This returns an error: Unexpected token, expected ",". Using commas instead fixes the error but then "sub.url.com" stays "sub.url.com" and does not change to "url.com".

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

0 participants