login register comlated
This commit is contained in:
@@ -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<Metadata> {
|
||||
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) {
|
||||
</ThemeProvider>
|
||||
</NextIntlClientProvider>
|
||||
</body>
|
||||
|
||||
<Script
|
||||
src="https://buttons.github.io/buttons.js"
|
||||
strategy="lazyOnload"
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 25 KiB |
29
src/app/sitemap.ts
Normal file
29
src/app/sitemap.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import { MetadataRoute } from 'next';
|
||||
|
||||
const SITE_URL = process.env.NEXT_PUBLIC_SITE_URL ?? 'https://antiplagiat.uz';
|
||||
const LOCALES = ['uz', 'ru', 'en'] as const;
|
||||
|
||||
// Add your static page slugs here
|
||||
const STATIC_ROUTES = ['', '/about', '/history', '/contact'];
|
||||
|
||||
export default function sitemap(): MetadataRoute.Sitemap {
|
||||
const entries: MetadataRoute.Sitemap = [];
|
||||
|
||||
for (const locale of LOCALES) {
|
||||
for (const route of STATIC_ROUTES) {
|
||||
entries.push({
|
||||
url: `${SITE_URL}/${locale}${route}`,
|
||||
lastModified: new Date(),
|
||||
changeFrequency: route === '' ? 'daily' : 'weekly',
|
||||
priority: route === '' ? 1.0 : 0.8,
|
||||
alternates: {
|
||||
languages: Object.fromEntries(
|
||||
LOCALES.map((l) => [l, `${SITE_URL}/${l}${route}`]),
|
||||
),
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return entries;
|
||||
}
|
||||
Reference in New Issue
Block a user