我具有以下文件夹结构:
/pages/user/_user
以及我当前在nuxt.config中的机器人对象
robots: {
UserAgent: '*',
Disallow: '/user',
Sitemap:
'https://www.misite.com/sitemap.xml'
},
我没有在模块的文档中找到任何相关的内容,所以我想知道如何disallow / _user URL?
不确定是否可以使用robots模块,但不要忘记您可以在用户页面上添加noindex标记。
<script>
export default {
head () {
return {
meta: [
{ hid: 'robots', name: 'robots', content: 'noindex' }
]
}
}
}
</script>