【发布时间】:2020-08-03 14:39:11
【问题描述】:
我是 Gatsby 的新手,找不到解决方案: 我部署了一个网站,它现在只是一个“即将推出”的登陆页面。 我截取了一个屏幕截图,我想将其用作所有内容的 og-image... 它现在位于 src/images 但是:
-
如果我不在任何地方导入它,构建后它就不会在公共文件夹中可用
-
如果我导入它,它在静态文件夹中但具有唯一的哈希,因此我无法使用 Helmet 在 SEO 文件中正确设置元标记。
return ( <Helmet htmlAttributes={{ lang, }} title={title} titleTemplate={`%s | ${site.siteMetadata.title}`} meta={[ { name: `description`, content: metaDescription, }, { property: `og:title`, content: title, }, { property: `og:description`, content: metaDescription, }, { property: `og:image`, content: 'https://example.com/{how to get to the url of my image???}', }, { property: `og:type`, content: `website`, }, { name: `twitter:card`, content: `summary`, }, { name: `twitter:creator`, content: site.siteMetadata.author, }, { name: `twitter:title`, content: title, }, { name: `twitter:description`, content: metaDescription, }, ].concat(meta)} /> )}
【问题讨论】:
标签: gatsby