feat: add sitemap
This commit is contained in:
@@ -1,5 +1,33 @@
|
||||
// TODO Проверить что это за страница
|
||||
import { Ocenochnaya } from '@/views';
|
||||
import type { Metadata } from 'next';
|
||||
import { headers } from 'next/headers';
|
||||
import { metaInfo, phoneBeautify } from '@shared/lib';
|
||||
import { TMetainfo } from '@shared/types/metainfo';
|
||||
import { CONTACTS } from '@shared/const/contacts';
|
||||
|
||||
const metainfo: TMetainfo = {
|
||||
title: 'Оценочная экспертиза',
|
||||
description: `Проведение оценочной экспертизы. Лицензированные эксперты. Экспертиза принимается судом. Тел.: ${phoneBeautify(CONTACTS.PHONE)}. Предварительный анализ - бесплатно!`,
|
||||
companyName: CONTACTS.COMPANY_FULL,
|
||||
phone: phoneBeautify(CONTACTS.PHONE),
|
||||
ogImageUrl: '/images/opengraph/expertise/ocenka.png',
|
||||
};
|
||||
|
||||
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 <div>Page</div>;
|
||||
return <Ocenochnaya />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user