NextJS中文文档 - HtmlLimitedBots
htmlLimitedBots
配置允许您指定一个用户代理列表,这些用户代理应接收阻塞元数据,而不是流式元数据。
ts
import type { NextConfig } from 'next'
const config: NextConfig = {
htmlLimitedBots: 'MySpecialBot|MyAnotherSpecialBot|SimpleCrawler',
}
export default config
1
2
3
4
5
6
7
2
3
4
5
6
7
js
module.exports = {
htmlLimitedBots: 'MySpecialBot|MyAnotherSpecialBot|SimpleCrawler',
}
1
2
3
2
3
默认列表
Next.js 包含一个 HTML 受限机器人的默认列表。
指定 htmlLimitedBots
配置将覆盖 Next.js 的默认列表,使您能够完全控制哪些用户代理应该选择使用此行为。但这是高级行为,对于大多数情况,默认设置应该足够。
版本历史
版本 | 变更 |
---|---|
15.2.0 | 引入 htmlLimitedBots 选项。 |