import type { MetadataRoute } from 'next' const siteUrl = process.env.NEXT_PUBLIC_SITE_URL || 'https://trumpsignal.com' // Settings page is user-personalized (wallet address, HL keys, alert prefs). // Disallow under every locale prefix in case any /zh URLs survive in the wild // — i18n is shelved but the routes still resolve. const SETTINGS_DENY = ['/api/', '/_next/', '/en/settings', '/zh/settings'] export default function robots(): MetadataRoute.Robots { return { rules: [ { userAgent: '*', allow: '/', disallow: SETTINGS_DENY, }, // Explicitly allow AI crawlers (GEO — ensures ChatGPT/Perplexity/Claude index the site) { userAgent: 'GPTBot', allow: '/', disallow: SETTINGS_DENY }, { userAgent: 'ChatGPT-User', allow: '/', disallow: SETTINGS_DENY }, { userAgent: 'PerplexityBot', allow: '/', disallow: SETTINGS_DENY }, { userAgent: 'ClaudeBot', allow: '/', disallow: SETTINGS_DENY }, { userAgent: 'anthropic-ai', allow: '/', disallow: ['/api/', '/_next/'] }, { userAgent: 'Googlebot', allow: '/' }, { userAgent: 'Bingbot', allow: '/' }, ], sitemap: `${siteUrl}/sitemap.xml`, host: siteUrl, } }