【问题标题】:How to add link to Gatsby config file如何添加到 Gatsby 配置文件的链接
【发布时间】:2019-10-11 19:22:14
【问题描述】:

我正在尝试在 gatsby-config.js 文件中插入快捷方式图标的链接,但它似乎不起作用。显然我也在使用graphql。

module.exports = {
  siteMetadata: {
    title: 'xxxx',
    description: 'xxxx',
    keywords:
      'test test test',
    link: [
      {
        rel: 'shortcut icon',
        url:
          'https://xxxx.png',
      },
    ],
  },
  plugins: ['gatsby-plugin-react-helmet'],
  plugins: [
    {
      resolve: 'gatsby-plugin-html-attributes',
      options: {
        lang: 'en',
      },
    },
  ],
}

【问题讨论】:

  • 你需要通过gatsby-plugin-manifestdocs添加这个

标签: reactjs gatsby


【解决方案1】:

Here 是您可以在gatsby-cnfig 中添加的选项。来自文档:

可在 gatsby-config.js 中设置的选项包括:

  1. 站点元数据(对象)
  2. 插件(数组)
  3. 路径前缀(字符串)
  4. polyfill(布尔值)
  5. 映射(对象)
  6. 代理(对象)
  7. developMiddleware(函数)

“快捷方式链接”不是这些选项的一部分。

TLDR:你不能。

【讨论】:

    猜你喜欢
    • 2021-04-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-06
    • 1970-01-01
    • 2013-06-16
    相关资源
    最近更新 更多