diff --git a/ROBOTS.txt b/ROBOTS.txt new file mode 100644 index 0000000..3696dbe --- /dev/null +++ b/ROBOTS.txt @@ -0,0 +1,10 @@ +User-agent: * +Allow: / + +# Block admin and API routes from indexing +Disallow: /api/ +Disallow: /_next/ +Disallow: /admin/ + +# Sitemap location +Sitemap: https://antiplagiat.uz/sitemap.xml \ No newline at end of file diff --git a/src/app/[locale]/layout.tsx b/src/app/[locale]/layout.tsx index 298e695..e3f8a64 100644 --- a/src/app/[locale]/layout.tsx +++ b/src/app/[locale]/layout.tsx @@ -12,18 +12,34 @@ import QueryProvider from '@/shared/config/react-query/QueryProvider'; import Script from 'next/script'; import Provider from '@/features/providers/provider'; import { ToastContainer } from 'react-toastify'; +import type { Metadata } from 'next'; +import { generateRootMetadata } from '@/shared/lib/metadata'; + +// ─── Types ───────────────────────────────────────────────────────────────────── type Props = { children: ReactNode; params: Promise<{ locale: Locale }>; }; +// ─── Static params ───────────────────────────────────────────────────────────── + export function generateStaticParams() { return routing.locales.map((locale) => ({ locale })); } +// ─── Metadata (OpenGraph + SEO) ──────────────────────────────────────────────── + +export async function generateMetadata({ params }: Props): Promise { + const { locale } = await params; + return generateRootMetadata(locale); +} + +// ─── Layout ──────────────────────────────────────────────────────────────────── + export default async function RootLayout({ children, params }: Props) { const { locale } = await params; + if (!hasLocale(routing.locales, locale)) { notFound(); } @@ -52,6 +68,7 @@ export default async function RootLayout({ children, params }: Props) { +