Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/389.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Twitter告诉我找不到卡片的错误(卡片错误)_Javascript_Reactjs_Gatsby - Fatal编程技术网

Javascript Twitter告诉我找不到卡片的错误(卡片错误)

Javascript Twitter告诉我找不到卡片的错误(卡片错误),javascript,reactjs,gatsby,Javascript,Reactjs,Gatsby,我试图将twitter卡添加到盖茨比网站,但当我试图查看它们是否有效时,它会告诉我“错误未找到卡(卡错误)”。然而twitter上的标签是:卡片就在那里 module.exports={ 站点元数据:{ 标题:“xxx”, 描述:“xxx”, 关键词:'xxx', 作者:'xxx', 推特卡片:“摘要”\u大图”, twitter_创建者:“@xxx”, twitter_站点:'@xxx', og_标题:“xxx”, og_图像:'https://www.example.com/', og_u

我试图将twitter卡添加到盖茨比网站,但当我试图查看它们是否有效时,它会告诉我“错误未找到卡(卡错误)”。然而twitter上的标签是:卡片就在那里

module.exports={
站点元数据:{
标题:“xxx”,
描述:“xxx”,
关键词:'xxx',
作者:'xxx',
推特卡片:“摘要”\u大图”,
twitter_创建者:“@xxx”,
twitter_站点:'@xxx',
og_标题:“xxx”,
og_图像:'https://www.example.com/',
og_url:'https://example.netlify.com/',
og_类型:“网站”,
og_标题:“xxx”,
og_描述:“xxx”,
og_图像:'https://www.example.com/',
},
插件:['gatsby-plugin-react-helmet'],
插件:[
{
解析:“盖茨比插件html属性”,
选项:{
朗:"嗯",,
},
},
],
}

我不知道在
站点元数据中添加所有这些twitter属性是否正确

我知道您可以在seo组件中实现所有这些OpenGraphTwitter元属性。它在我的项目中起了作用。看。使用
react头盔
。查找以下代码段:

          <Helmet title={seo.title} titleTemplate={titleTemplate}>
            <meta name="description" content={seo.description} />
            <meta name="image" content={seo.image} />
            {seo.url && <meta property="og:url" content={seo.url} />}
            {(article ? true : null) && (
              <meta property="og:type" content="article" />
            )}
            {seo.title && <meta property="og:title" content={seo.title} />}
            {seo.description && (
              <meta property="og:description" content={seo.description} />
            )}
            {seo.image && <meta property="og:image" content={seo.image} />}
            <meta name="twitter:card" content="summary_large_image" />
            {twitterUsername && (
              <meta name="twitter:creator" content={twitterUsername} />
            )}
            {seo.title && <meta name="twitter:title" content={seo.title} />}
            {seo.description && (
              <meta name="twitter:description" content={seo.description} />
            )}
            {seo.image && <meta name="twitter:image" content={seo.image} />}
          </Helmet>
        </>

{seo.url&&}
{(文章?真:空)&&(
)}
{seo.title&}
{seo.description&&(
)}
{seo.image&&}
{twitterUsername&&(
)}
{seo.title&}
{seo.description&&(
)}
{seo.image&&}

我不知道在
站点元数据中添加所有这些twitter属性是否正确

我知道您可以在seo组件中实现所有这些OpenGraphTwitter元属性。它在我的项目中起了作用。看。使用
react头盔
。查找以下代码段:

          <Helmet title={seo.title} titleTemplate={titleTemplate}>
            <meta name="description" content={seo.description} />
            <meta name="image" content={seo.image} />
            {seo.url && <meta property="og:url" content={seo.url} />}
            {(article ? true : null) && (
              <meta property="og:type" content="article" />
            )}
            {seo.title && <meta property="og:title" content={seo.title} />}
            {seo.description && (
              <meta property="og:description" content={seo.description} />
            )}
            {seo.image && <meta property="og:image" content={seo.image} />}
            <meta name="twitter:card" content="summary_large_image" />
            {twitterUsername && (
              <meta name="twitter:creator" content={twitterUsername} />
            )}
            {seo.title && <meta name="twitter:title" content={seo.title} />}
            {seo.description && (
              <meta name="twitter:description" content={seo.description} />
            )}
            {seo.image && <meta name="twitter:image" content={seo.image} />}
          </Helmet>
        </>

{seo.url&&}
{(文章?真:空)&&(
)}
{seo.title&}
{seo.description&&(
)}
{seo.image&&}
{twitterUsername&&(
)}
{seo.title&}
{seo.description&&(
)}
{seo.image&&}

这就是我现在要做的,只是我不知道如何用graphql实现它:(这就是我现在要做的,只是我不知道如何用graphql实现它:(