fix: update metatags gen

This commit is contained in:
2025-12-11 15:12:20 +03:00
parent 765b65a00a
commit 3aa39d96ca
18 changed files with 319 additions and 82 deletions

View File

@@ -1,19 +1,33 @@
import { headers } from 'next/headers';
import { Contacts } from '@/views';
import type { Metadata } from 'next';
import { metaInfo } from '@shared/lib';
import { TMetainfo } from '@shared/types/metainfo';
const metainfo = {
const metainfo: TMetainfo = {
title: 'Контакты',
description:
'Услуги независимой оценки и судебной экспертизы в Сочи и Краснодаре.',
companyName: 'Компания ДИТРАСО',
phone: '+7 (900) 241-34-34',
url: 'https://ocenka-sochi.ru',
ogImageTitle: 'Оценка и экспертиза',
ogImageDescription: 'Независимая оценка и судебная экспертиза',
};
export const metadata: Metadata = metaInfo(metainfo);
export async function generateMetadata(): Promise<Metadata> {
const h = await headers();
const referer = h.get('referer') ?? '';
const host = h.get('host') ?? '';
const proto = h.get('x-forwarded-proto') ?? '';
const path = referer ? new URL(referer).pathname : '';
const metainfoExtended = Object.assign({}, metainfo, {
host: `${proto}://${host}`,
path: path,
});
return metaInfo(metainfoExtended);
}
export default function Page() {
return <Contacts />;

View File

@@ -1,19 +1,33 @@
import { Cookie } from '@/views';
import type { Metadata } from 'next';
import { metaInfo } from '@shared/lib';
import { headers } from 'next/headers';
import { TMetainfo } from '@shared/types/metainfo';
const metainfo = {
const metainfo: TMetainfo = {
title: 'Независимая оценка и судебная экспертиза',
description:
'Услуги независимой оценки и судебной экспертизы в Сочи и Краснодаре.',
companyName: 'Компания ДИТРАСО',
phone: '+7 (900) 241-34-34',
url: 'https://ocenka-sochi.ru',
ogImageTitle: 'Оценка и экспертиза',
ogImageDescription: 'Независимая оценка и судебная экспертиза',
};
export const metadata: Metadata = metaInfo(metainfo);
export async function generateMetadata(): Promise<Metadata> {
const h = await headers();
const referer = h.get('referer') ?? '';
const host = h.get('host') ?? '';
const proto = h.get('x-forwarded-proto') ?? '';
const path = referer ? new URL(referer).pathname : '';
const metainfoExtended = Object.assign({}, metainfo, {
host: `${proto}://${host}`,
path: path,
});
return metaInfo(metainfoExtended);
}
export default function Page() {
return <Cookie />;

View File

@@ -1,19 +1,33 @@
import { ExpertBorodin } from '@/views';
import type { Metadata } from 'next';
import { metaInfo } from '@shared/lib';
import { headers } from 'next/headers';
import { TMetainfo } from '@shared/types/metainfo';
const metainfo = {
const metainfo: TMetainfo = {
title: 'Эксперт - Бородин Виталий Петрович',
description:
'Услуги независимой оценки и судебной экспертизы в Сочи и Краснодаре.',
companyName: 'Компания ДИТРАСО',
phone: '+7 (900) 241-34-34',
url: 'https://ocenka-sochi.ru',
ogImageTitle: 'Оценка и экспертиза',
ogImageDescription: 'Независимая оценка и судебная экспертиза',
};
export const metadata: Metadata = metaInfo(metainfo);
export async function generateMetadata(): Promise<Metadata> {
const h = await headers();
const referer = h.get('referer') ?? '';
const host = h.get('host') ?? '';
const proto = h.get('x-forwarded-proto') ?? '';
const path = referer ? new URL(referer).pathname : '';
const metainfoExtended = Object.assign({}, metainfo, {
host: `${proto}://${host}`,
path: path,
});
return metaInfo(metainfoExtended);
}
export default function Page() {
return <ExpertBorodin />;

View File

@@ -1,19 +1,33 @@
import { ExpertGulmamedov } from '@/views';
import type { Metadata } from 'next';
import { metaInfo } from '@shared/lib';
import { headers } from 'next/headers';
import { TMetainfo } from '@shared/types/metainfo';
const metainfo = {
const metainfo: TMetainfo = {
title: 'Эксперт - Гюльмамедов Явар Фирмамед-оглы',
description:
'Услуги независимой оценки и судебной экспертизы в Сочи и Краснодаре.',
companyName: 'Компания ДИТРАСО',
phone: '+7 (900) 241-34-34',
url: 'https://ocenka-sochi.ru',
ogImageTitle: 'Оценка и экспертиза',
ogImageDescription: 'Независимая оценка и судебная экспертиза',
};
export const metadata: Metadata = metaInfo(metainfo);
export async function generateMetadata(): Promise<Metadata> {
const h = await headers();
const referer = h.get('referer') ?? '';
const host = h.get('host') ?? '';
const proto = h.get('x-forwarded-proto') ?? '';
const path = referer ? new URL(referer).pathname : '';
const metainfoExtended = Object.assign({}, metainfo, {
host: `${proto}://${host}`,
path: path,
});
return metaInfo(metainfoExtended);
}
export default function Page() {
return <ExpertGulmamedov />;

View File

@@ -1,19 +1,33 @@
import { ExpertYancen } from '@/views';
import type { Metadata } from 'next';
import { metaInfo } from '@shared/lib';
import { headers } from 'next/headers';
import { TMetainfo } from '@shared/types/metainfo';
const metainfo = {
const metainfo: TMetainfo = {
title: 'Эксперт - Янцен Яна Николаевна',
description:
'Услуги независимой оценки и судебной экспертизы в Сочи и Краснодаре.',
companyName: 'Компания ДИТРАСО',
phone: '+7 (900) 241-34-34',
url: 'https://ocenka-sochi.ru',
ogImageTitle: 'Оценка и экспертиза',
ogImageDescription: 'Независимая оценка и судебная экспертиза',
};
export const metadata: Metadata = metaInfo(metainfo);
export async function generateMetadata(): Promise<Metadata> {
const h = await headers();
const referer = h.get('referer') ?? '';
const host = h.get('host') ?? '';
const proto = h.get('x-forwarded-proto') ?? '';
const path = referer ? new URL(referer).pathname : '';
const metainfoExtended = Object.assign({}, metainfo, {
host: `${proto}://${host}`,
path: path,
});
return metaInfo(metainfoExtended);
}
export default function Page() {
return <ExpertYancen />;

View File

@@ -1,19 +1,33 @@
import { ExpertKaminskiy } from '@/views';
import type { Metadata } from 'next';
import { metaInfo } from '@shared/lib';
import { headers } from 'next/headers';
import { TMetainfo } from '@shared/types/metainfo';
const metainfo = {
const metainfo: TMetainfo = {
title: 'Эксперт - Каминский Дмитрий Олегович',
description:
'Услуги независимой оценки и судебной экспертизы в Сочи и Краснодаре.',
companyName: 'Компания ДИТРАСО',
phone: '+7 (900) 241-34-34',
url: 'https://ocenka-sochi.ru',
ogImageTitle: 'Оценка и экспертиза',
ogImageDescription: 'Независимая оценка и судебная экспертиза',
};
export const metadata: Metadata = metaInfo(metainfo);
export async function generateMetadata(): Promise<Metadata> {
const h = await headers();
const referer = h.get('referer') ?? '';
const host = h.get('host') ?? '';
const proto = h.get('x-forwarded-proto') ?? '';
const path = referer ? new URL(referer).pathname : '';
const metainfoExtended = Object.assign({}, metainfo, {
host: `${proto}://${host}`,
path: path,
});
return metaInfo(metainfoExtended);
}
export default function Page() {
return <ExpertKaminskiy />;

View File

@@ -1,19 +1,33 @@
import { ExpertKolodiy } from '@/views';
import type { Metadata } from 'next';
import { metaInfo } from '@shared/lib';
import { headers } from 'next/headers';
import { TMetainfo } from '@shared/types/metainfo';
const metainfo = {
const metainfo: TMetainfo = {
title: 'Эксперт - Колодий Александр Сергеевич',
description:
'Услуги независимой оценки и судебной экспертизы в Сочи и Краснодаре.',
companyName: 'Компания ДИТРАСО',
phone: '+7 (900) 241-34-34',
url: 'https://ocenka-sochi.ru',
ogImageTitle: 'Оценка и экспертиза',
ogImageDescription: 'Независимая оценка и судебная экспертиза',
};
export const metadata: Metadata = metaInfo(metainfo);
export async function generateMetadata(): Promise<Metadata> {
const h = await headers();
const referer = h.get('referer') ?? '';
const host = h.get('host') ?? '';
const proto = h.get('x-forwarded-proto') ?? '';
const path = referer ? new URL(referer).pathname : '';
const metainfoExtended = Object.assign({}, metainfo, {
host: `${proto}://${host}`,
path: path,
});
return metaInfo(metainfoExtended);
}
export default function Page() {
return <ExpertKolodiy />;

View File

@@ -1,19 +1,33 @@
import { ExpertMikova } from '@/views';
import type { Metadata } from 'next';
import { metaInfo } from '@shared/lib';
import { headers } from 'next/headers';
import { TMetainfo } from '@shared/types/metainfo';
const metainfo = {
const metainfo: TMetainfo = {
title: 'Эксперт - Микова Инна Георгиевна',
description:
'Услуги независимой оценки и судебной экспертизы в Сочи и Краснодаре.',
companyName: 'Компания ДИТРАСО',
phone: '+7 (900) 241-34-34',
url: 'https://ocenka-sochi.ru',
ogImageTitle: 'Оценка и экспертиза',
ogImageDescription: 'Независимая оценка и судебная экспертиза',
};
export const metadata: Metadata = metaInfo(metainfo);
export async function generateMetadata(): Promise<Metadata> {
const h = await headers();
const referer = h.get('referer') ?? '';
const host = h.get('host') ?? '';
const proto = h.get('x-forwarded-proto') ?? '';
const path = referer ? new URL(referer).pathname : '';
const metainfoExtended = Object.assign({}, metainfo, {
host: `${proto}://${host}`,
path: path,
});
return metaInfo(metainfoExtended);
}
export default function Page() {
return <ExpertMikova />;

View File

@@ -1,19 +1,33 @@
import { ExpertMityaev } from '@/views';
import type { Metadata } from 'next';
import { metaInfo } from '@shared/lib';
import { headers } from 'next/headers';
import { TMetainfo } from '@shared/types/metainfo';
const metainfo = {
const metainfo: TMetainfo = {
title: 'Эксперт - Митяев Алексей Александрович',
description:
'Услуги независимой оценки и судебной экспертизы в Сочи и Краснодаре.',
companyName: 'Компания ДИТРАСО',
phone: '+7 (900) 241-34-34',
url: 'https://ocenka-sochi.ru',
ogImageTitle: 'Оценка и экспертиза',
ogImageDescription: 'Независимая оценка и судебная экспертиза',
};
export const metadata: Metadata = metaInfo(metainfo);
export async function generateMetadata(): Promise<Metadata> {
const h = await headers();
const referer = h.get('referer') ?? '';
const host = h.get('host') ?? '';
const proto = h.get('x-forwarded-proto') ?? '';
const path = referer ? new URL(referer).pathname : '';
const metainfoExtended = Object.assign({}, metainfo, {
host: `${proto}://${host}`,
path: path,
});
return metaInfo(metainfoExtended);
}
export default function Page() {
return <ExpertMityaev />;

View File

@@ -1,19 +1,33 @@
import { Experts } from '@/views';
import type { Metadata } from 'next';
import { metaInfo } from '@shared/lib';
import { headers } from 'next/headers';
import { TMetainfo } from '@shared/types/metainfo';
const metainfo = {
const metainfo: TMetainfo = {
title: 'Эксперты',
description:
'Услуги независимой оценки и судебной экспертизы в Сочи и Краснодаре.',
companyName: 'Компания ДИТРАСО',
phone: '+7 (900) 241-34-34',
url: 'https://ocenka-sochi.ru',
ogImageTitle: 'Оценка и экспертиза',
ogImageDescription: 'Независимая оценка и судебная экспертиза',
};
export const metadata: Metadata = metaInfo(metainfo);
export async function generateMetadata(): Promise<Metadata> {
const h = await headers();
const referer = h.get('referer') ?? '';
const host = h.get('host') ?? '';
const proto = h.get('x-forwarded-proto') ?? '';
const path = referer ? new URL(referer).pathname : '';
const metainfoExtended = Object.assign({}, metainfo, {
host: `${proto}://${host}`,
path: path,
});
return metaInfo(metainfoExtended);
}
export default function Page() {
return <Experts />;

View File

@@ -1,19 +1,33 @@
import { ExpertPolinov } from '@/views';
import type { Metadata } from 'next';
import { metaInfo } from '@shared/lib';
import { headers } from 'next/headers';
import { TMetainfo } from '@shared/types/metainfo';
const metainfo = {
const metainfo: TMetainfo = {
title: 'Эксперт - Полинов Андрей Владимирович',
description:
'Услуги независимой оценки и судебной экспертизы в Сочи и Краснодаре.',
companyName: 'Компания ДИТРАСО',
phone: '+7 (900) 241-34-34',
url: 'https://ocenka-sochi.ru',
ogImageTitle: 'Оценка и экспертиза',
ogImageDescription: 'Независимая оценка и судебная экспертиза',
};
export const metadata: Metadata = metaInfo(metainfo);
export async function generateMetadata(): Promise<Metadata> {
const h = await headers();
const referer = h.get('referer') ?? '';
const host = h.get('host') ?? '';
const proto = h.get('x-forwarded-proto') ?? '';
const path = referer ? new URL(referer).pathname : '';
const metainfoExtended = Object.assign({}, metainfo, {
host: `${proto}://${host}`,
path: path,
});
return metaInfo(metainfoExtended);
}
export default function Page() {
return <ExpertPolinov />;

View File

@@ -1,19 +1,33 @@
import { ExpertVolkovaGoncharova } from '@/views';
import type { Metadata } from 'next';
import { metaInfo } from '@shared/lib';
import { headers } from 'next/headers';
import { TMetainfo } from '@shared/types/metainfo';
const metainfo = {
const metainfo: TMetainfo = {
title: 'Эксперт - Волкова-Гончарова Татьяна Анатольевна',
description:
'Услуги независимой оценки и судебной экспертизы в Сочи и Краснодаре.',
companyName: 'Компания ДИТРАСО',
phone: '+7 (900) 241-34-34',
url: 'https://ocenka-sochi.ru',
ogImageTitle: 'Оценка и экспертиза',
ogImageDescription: 'Независимая оценка и судебная экспертиза',
};
export const metadata: Metadata = metaInfo(metainfo);
export async function generateMetadata(): Promise<Metadata> {
const h = await headers();
const referer = h.get('referer') ?? '';
const host = h.get('host') ?? '';
const proto = h.get('x-forwarded-proto') ?? '';
const path = referer ? new URL(referer).pathname : '';
const metainfoExtended = Object.assign({}, metainfo, {
host: `${proto}://${host}`,
path: path,
});
return metaInfo(metainfoExtended);
}
export default function Page() {
return <ExpertVolkovaGoncharova />;

View File

@@ -1,19 +1,33 @@
import { Home } from '@/views';
import type { Metadata } from 'next';
import { metaInfo } from '@shared/lib';
import { headers } from 'next/headers';
import { TMetainfo } from '@shared/types/metainfo';
const metainfo = {
const metainfo: TMetainfo = {
title: 'Независимая оценка и судебная экспертиза',
description:
'Услуги независимой оценки и судебной экспертизы в Сочи и Краснодаре.',
companyName: 'Компания ДИТРАСО',
phone: '+7 (900) 241-34-34',
url: 'https://ocenka-sochi.ru',
ogImageTitle: 'Оценка и экспертиза',
ogImageDescription: 'Независимая оценка и судебная экспертиза',
};
export const metadata: Metadata = metaInfo(metainfo);
export async function generateMetadata(): Promise<Metadata> {
const h = await headers();
const referer = h.get('referer') ?? '';
const host = h.get('host') ?? '';
const proto = h.get('x-forwarded-proto') ?? '';
const path = referer ? new URL(referer).pathname : '';
const metainfoExtended = Object.assign({}, metainfo, {
host: `${proto}://${host}`,
path: path,
});
return metaInfo(metainfoExtended);
}
export default function HomePage() {
return <Home />;

View File

@@ -1,19 +1,33 @@
import { PrivacyPolicy } from '@/views';
import type { Metadata } from 'next';
import { metaInfo } from '@shared/lib';
import { headers } from 'next/headers';
import { TMetainfo } from '@shared/types/metainfo';
const metainfo = {
const metainfo: TMetainfo = {
title: 'Независимая оценка и судебная экспертиза',
description:
'Услуги независимой оценки и судебной экспертизы в Сочи и Краснодаре.',
companyName: 'Компания ДИТРАСО',
phone: '+7 (900) 241-34-34',
url: 'https://ocenka-sochi.ru',
ogImageTitle: 'Оценка и экспертиза',
ogImageDescription: 'Независимая оценка и судебная экспертиза',
};
export const metadata: Metadata = metaInfo(metainfo);
export async function generateMetadata(): Promise<Metadata> {
const h = await headers();
const referer = h.get('referer') ?? '';
const host = h.get('host') ?? '';
const proto = h.get('x-forwarded-proto') ?? '';
const path = referer ? new URL(referer).pathname : '';
const metainfoExtended = Object.assign({}, metainfo, {
host: `${proto}://${host}`,
path: path,
});
return metaInfo(metainfoExtended);
}
export default function Page() {
return <PrivacyPolicy />;

View File

@@ -1,19 +1,33 @@
import { UserAgreement } from '@/views';
import type { Metadata } from 'next';
import { metaInfo } from '@shared/lib';
import { headers } from 'next/headers';
import { TMetainfo } from '@shared/types/metainfo';
const metainfo = {
const metainfo: TMetainfo = {
title: 'Независимая оценка и судебная экспертиза',
description:
'Услуги независимой оценки и судебной экспертизы в Сочи и Краснодаре.',
companyName: 'Компания ДИТРАСО',
phone: '+7 (900) 241-34-34',
url: 'https://ocenka-sochi.ru',
ogImageTitle: 'Оценка и экспертиза',
ogImageDescription: 'Независимая оценка и судебная экспертиза',
};
export const metadata: Metadata = metaInfo(metainfo);
export async function generateMetadata(): Promise<Metadata> {
const h = await headers();
const referer = h.get('referer') ?? '';
const host = h.get('host') ?? '';
const proto = h.get('x-forwarded-proto') ?? '';
const path = referer ? new URL(referer).pathname : '';
const metainfoExtended = Object.assign({}, metainfo, {
host: `${proto}://${host}`,
path: path,
});
return metaInfo(metainfoExtended);
}
export default function Page() {
return <UserAgreement />;

View File

@@ -5,7 +5,8 @@ type TMetaInfo = {
description: string;
companyName: string;
phone: string;
url: string;
host: string;
path: string;
ogImageTitle: string;
ogImageDescription: string;
width?: number;
@@ -20,7 +21,8 @@ function metaInfo({ ...props }: TMetaInfo): Metadata {
description,
companyName,
phone,
url,
host,
path = '',
ogImageTitle,
ogImageDescription,
width = 600,
@@ -35,11 +37,10 @@ function metaInfo({ ...props }: TMetaInfo): Metadata {
openGraph: {
title: title,
description: description,
url: url,
url: `${host}${path}`,
images: [
{
url: `${url}/api/og/?title=${ogImageTitle}&description=${ogImageDescription}`,
secureUrl: `${url}/api/og/?title=${ogImageTitle}&description=${ogImageDescription}`,
url: `${host}/api/og/?title=${ogImageTitle}&description=${ogImageDescription}`,
width: width,
height: height,
alt: `${title} - ${companyName}`,
@@ -56,7 +57,7 @@ function metaInfo({ ...props }: TMetaInfo): Metadata {
creator: creator,
images: [
{
url: `${url}/api/og/?title=${ogImageTitle}&description=${ogImageDescription}`,
url: `${host}/api/og/?title=${ogImageTitle}&description=${ogImageDescription}`,
width: width,
height: height,
alt: `${title} - ${companyName}`,

View File

@@ -0,0 +1,8 @@
export type TMetainfo = {
title: string;
description: string;
companyName: string;
phone: string;
ogImageTitle: string;
ogImageDescription: string;
};