【问题标题】:dynamic meta tags with react-helmet and gatsby not workingreact-helmet 和 gatsby 的动态元标记不起作用
【发布时间】:2021-10-10 13:42:09
【问题描述】:

所以我使用 react-helmet 在 gatsby 中创建 SEO 对象,更新后的元标记可以在开发人员工具中看到,但是当使用网络爬虫时,没有动态元标记,有谁知道如何修复这个?

【问题讨论】:

    标签: seo gatsby react-helmet


    【解决方案1】:

    只需使用gatsby-plugin-react-helmetreact-helmet

    在你的gatsby-config.js

    plugins: [`gatsby-plugin-react-helmet`]
    

    这是因为您需要提供静态属性而不是动态属性,因此您需要添加对 SSR(Server-Side R渲染)。

    【讨论】:

      猜你喜欢
      • 2021-02-14
      • 2021-01-18
      • 2019-10-14
      • 1970-01-01
      • 1970-01-01
      • 2018-04-15
      • 1970-01-01
      • 2021-09-22
      • 1970-01-01
      相关资源
      最近更新 更多