- Add robots.txt with admin/API blocking - Add dynamic sitemap.xml with static pages and genre pages - Implement full meta tags (Open Graph, Twitter Cards, Canonical, Alternates) - Add SEO helper functions for domain detection and URL generation - Add generateMetadata to all pages (homepage, about, genre, special) - Support automatic domain detection for hoerdle.de and hördle.de - Add SEO configuration to lib/config.ts
21 lines
563 B
TypeScript
21 lines
563 B
TypeScript
import { MetadataRoute } from 'next';
|
|
import { config } from '@/lib/config';
|
|
|
|
export default function robots(): MetadataRoute.Robots {
|
|
const baseUrl = process.env.NEXT_PUBLIC_DOMAIN || config.domain;
|
|
const protocol = process.env.NODE_ENV === 'production' ? 'https' : 'http';
|
|
const siteUrl = `${protocol}://${baseUrl}`;
|
|
|
|
return {
|
|
rules: [
|
|
{
|
|
userAgent: '*',
|
|
allow: '/',
|
|
disallow: ['/admin/', '/api/'],
|
|
},
|
|
],
|
|
sitemap: `${siteUrl}/sitemap.xml`,
|
|
};
|
|
}
|
|
|