The Node.js® Website
at main 646 B view raw
1import type { MetadataRoute } from 'next'; 2 3// This allows us to generate a `robots.txt` file dynamically based on the needs of the Node.js Website 4// @see https://nextjs.org/docs/app/api-reference/file-conventions/metadata/robots 5const robots = (): MetadataRoute.Robots => ({ 6 rules: [ 7 { 8 userAgent: '*', 9 disallow: ['/dist/', '/docs/'], 10 allow: ['/dist/latest/', '/dist/latest/docs/api/', '/api/'], 11 }, 12 ], 13}); 14 15export default robots; 16 17// Enforces that this route is used as static rendering 18// @see https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config#dynamic 19export const dynamic = 'error';