35cf930572
### What? Followup for #47630 , use ts namespace to group MetadataRoute. `MetadataRoute['xxx']` -> `MetadataRoute.xxx` ### Why? namespace is convenient to write for these grouped types such as `MetadataRoute.Robots`. And `MetadataRoute` itself is not actually a type. So it can be conveniently typed by ts users. ### How? Closes NEXT-912 ---------
19 lines
398 B
TypeScript
19 lines
398 B
TypeScript
import type { MetadataRoute } from 'next'
|
|
|
|
export default function robots(): MetadataRoute.Robots {
|
|
return {
|
|
rules: [
|
|
{
|
|
userAgent: 'Googlebot',
|
|
allow: ['/'],
|
|
},
|
|
{
|
|
userAgent: ['Applebot', 'Bingbot'],
|
|
disallow: ['/'],
|
|
crawlDelay: 2,
|
|
},
|
|
],
|
|
sitemap: 'https://example.com/sitemap.xml',
|
|
host: 'https://example.com',
|
|
}
|
|
}
|