From 4a3cbff0e65516f0f3a03ab5c09f573415fc9fb0 Mon Sep 17 00:00:00 2001 From: Mustafa Yildiz Date: Sun, 12 Jul 2026 15:17:58 +0300 Subject: [PATCH] chore: add robots.txt and sitemap.xml configuration --- app/robots.ts | 30 ++++++++++++++++++++++++++++++ app/sitemap.ts | 13 +++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 app/robots.ts create mode 100644 app/sitemap.ts diff --git a/app/robots.ts b/app/robots.ts new file mode 100644 index 0000000..65b5eee --- /dev/null +++ b/app/robots.ts @@ -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', + }; +} diff --git a/app/sitemap.ts b/app/sitemap.ts new file mode 100644 index 0000000..9d87926 --- /dev/null +++ b/app/sitemap.ts @@ -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, + })) +}