nuxt.js - 禁止使用 @nuxtjs/robots 模块的动态 URL
问题描述
我有以下文件夹结构:
/pages/user/_user
而我当前在 nuxt.config 中的机器人对象
robots: {
UserAgent: '*',
Disallow: '/user',
Sitemap:
'https://www.misite.com/sitemap.xml'
},
我没有在模块的文档中找到任何相关内容,所以我想知道如何禁止/_user URL?
解决方案
不确定是否可以使用 robots 模块,但不要忘记您可以将 noindex 标签添加到用户页面。
<script>
export default {
head () {
return {
meta: [
{ hid: 'robots', name: 'robots', content: 'noindex' }
]
}
}
}
</script>
推荐阅读
- powershell - 用 choco 升级 Powershell 不起作用
- javascript - Javascript 到 CSV 行不输出
- r - 如何在 R studio 中快速定位 R 脚本中某个单词的位置?
- html - 如果“太精确”,选择不起作用
- jquery - 使用 JQuery DataTables 滚动、模态和未对齐的标题
- html - BeautifulSoup4 和 HTML
- android - BottomNavigation 在按下更改状态时查看后退按钮
- isabelle - 如何在 Isabelle/HOL 中伪造存在类型?
- ruby-on-rails - 如何为 Rails 中的模型属性创建迁移
- r - R ValueError:检查输入时出错:预期 simple_rnn_input 有 3 个维度,但得到了形状为 (1661, 3) 的数组