From 4ee687768c512d34f459c9788ab89013aac01267 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Sun, 8 Dec 2024 20:59:38 +0300 Subject: [PATCH] add metadata --- app/page.tsx | 16 ++++++++++++++++ messages/ru.json | 4 ++++ 2 files changed, 20 insertions(+) diff --git a/app/page.tsx b/app/page.tsx index fe27269..97ed30c 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -3,6 +3,22 @@ import { Contacts } from '@/components/contacts'; import { Person } from '@/components/person'; import { Skills } from '@/components/skills'; import { Work } from '@/components/work'; +import { type Metadata } from 'next'; +import { getTranslations } from 'next-intl/server'; + +type Parameters = { + params: { + locale: string; + }; +}; + +export async function generateMetadata({ params: { locale } }: Parameters): Promise { + const t = await getTranslations({ locale, namespace: 'HomePage' }); + + return { + title: t('title'), + }; +} export default function HomePage() { return ( diff --git a/messages/ru.json b/messages/ru.json index a776af3..ad9c9c1 100644 --- a/messages/ru.json +++ b/messages/ru.json @@ -1,4 +1,8 @@ { + "HomePage": { + "title": "Влад Чикалкин", + "description": "веб-разработчик React Next.js Typescript" + }, "Person": { "hello": "Привет! Я Влад 👋", "description": "Веб-разработчик с широким опытом работы в различных проектах. Люблю технологии и создавать приятный софт"