【问题标题】:nuxt meta robots set to noindex when in production modenuxt meta robots 在生产模式下设置为 noindex
【发布时间】:2021-07-16 16:12:22
【问题描述】:

我不明白为什么我的应用程序仅在生产模式下将元机器人设置为 noindex ? 这是我的 nuxt.config

import i18n from './config/i18n'
export default {
  head: {
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: '' },
     { hid: 'robots', name: 'robots', content: 'index, follow' }
    ],
  },
  buildModules: ['nuxt-lazysizes',
    [
    'nuxt-i18n',
    {
      strategy: 'prefix_except_default',
      defaultLocale: 'en',
      seo: true,
      baseUrl: envBaseUrl,
      locales: [
        {
          code: 'en',
          name: 'English',
          iso: 'en-GB'
        },
        {
          code: 'fr',
          name: 'Français',
          iso: 'fr-FR'
        }
      ],
      vueI18n: i18n
    }
    ]
  ],
  env: {
    baseUrl: envBaseUrlAdmin
  },
}

我什至在布局 /default.vue 中设置了元数据以防万一,但还是一样。 这让我发疯! 在开发模式下完全没问题。为什么有人想要没有索引和开发或暂存的生产?这太荒谬了。

head () {
        return {
          meta: [{ hid: 'robots', name: 'robots', content: 'index, follow' }],
        }
    }

【问题讨论】:

    标签: seo nuxt.js nuxt-i18n


    【解决方案1】:

    好的,这与我的 Yoast 插件冲突。还没有找到为什么它只在 prod 中而不是在 dev 中这样做,但现在很好。抱歉这个愚蠢的问题。

    【讨论】:

      猜你喜欢
      • 2019-12-29
      • 2022-11-03
      • 2012-01-08
      • 2012-04-10
      • 2021-06-01
      • 1970-01-01
      • 2016-12-21
      • 2019-10-19
      • 2017-10-05
      相关资源
      最近更新 更多