chore: add robots.txt and sitemap.xml configuration

This commit is contained in:
Mustafa Yildiz
2026-07-12 15:17:58 +03:00
parent e4de0eb321
commit 4a3cbff0e6
2 changed files with 43 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
import type { MetadataRoute } from 'next';
const PROTECTED = ['/admin/', '/api/'];
export default function robots(): MetadataRoute.Robots {
return {
rules: [
{
userAgent: '*',
allow: '/',
disallow: PROTECTED,
},
// AI arama / citation botları
{ userAgent: 'OAI-SearchBot', allow: '/', disallow: PROTECTED },
{ userAgent: 'ChatGPT-User', allow: '/', disallow: PROTECTED },
{ userAgent: 'PerplexityBot', allow: '/', disallow: PROTECTED },
{ userAgent: 'Perplexity-User', allow: '/', disallow: PROTECTED },
{ userAgent: 'Claude-SearchBot', allow: '/', disallow: PROTECTED },
{ userAgent: 'Claude-User', allow: '/', disallow: PROTECTED },
// Training crawler'ları engelle
{ userAgent: 'GPTBot', disallow: '/' },
{ userAgent: 'ClaudeBot', disallow: '/' },
{ userAgent: 'Google-Extended', disallow: '/' },
{ userAgent: 'CCBot', disallow: '/' },
{ userAgent: 'Bytespider', disallow: '/' }, // ByteDance/TikTok
{ userAgent: 'Meta-ExternalAgent', disallow: '/' }, // Meta training
],
sitemap: 'https://menu.moybeachakyaka.com/sitemap.xml',
};
}
+13
View File
@@ -0,0 +1,13 @@
import { MetadataRoute } from 'next'
import { routing } from '@/i18n/routing'
export default function sitemap(): MetadataRoute.Sitemap {
const baseUrl = 'https://menu.moybeachakyaka.com'
return routing.locales.map((locale) => ({
url: `${baseUrl}/${locale}`,
lastModified: new Date(),
changeFrequency: 'daily',
priority: locale === routing.defaultLocale ? 1 : 0.8,
}))
}