From 1e75aadf10e18eecdc8e140b6ba6e2f6af51cb7c Mon Sep 17 00:00:00 2001 From: Joe Karow <58997957+JoeKarow@users.noreply.github.com> Date: Wed, 18 Sep 2024 19:09:51 -0400 Subject: [PATCH] fix metadata --- src/app/[locale]/gallery/page.tsx | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/app/[locale]/gallery/page.tsx b/src/app/[locale]/gallery/page.tsx index 3e0072b2..d93b3c56 100644 --- a/src/app/[locale]/gallery/page.tsx +++ b/src/app/[locale]/gallery/page.tsx @@ -1,20 +1,27 @@ -import { Image } from '~/app/_components/Image' import Link from 'next/link' +import type { Metadata } from 'next' +import { Image } from '~/app/_components/Image' import { artData } from '~/data/artwork' -import Logo from '~public/assets/tmf-logo-rect-bw-cropped.png' import { IBM_Plex_Sans } from 'next/font/google' +import Logo from '~public/assets/tmf-logo-rect-bw-cropped.png' import { AspectRatio, Button, Container, Grid, GridCol, Stack, Title, rem } from '@mantine/core' -import Head from 'next/head' import { StoryPreviewCarousel } from '~/app/_components/StoryPreviewCarousel' import { PopupArt } from '~/app/_components/PopupArt' -import classes from './page.module.css' import { initTranslations } from '~/app/i18n' +import classes from './page.module.css' const fontIbmPlexSans = IBM_Plex_Sans({ subsets: ['latin'], weight: ['300', '400'], display: 'swap' }) -const Page = async ({ params: { locale } }: { params: { locale: string } }) => { + +export const generateMetadata = async ({ params: { locale } }: PageProps): Promise => { + const { t } = await initTranslations(locale, ['common']) + return { + title: t('page-title.general-template', { page: t('nav.gallery') }), + } +} +const Page = async ({ params: { locale } }: PageProps) => { const { t } = await initTranslations(locale, ['common', 'art']) const slides = artData.map((art) => ( @@ -41,7 +48,7 @@ const Page = async ({ params: { locale } }: { params: { locale: string } }) => { mod={[{ 'slide-index': i }]} > {altText} { return ( - - {t('page-title.general-template', { page: '$t(nav.gallery)' })} - @@ -111,11 +115,9 @@ const Page = async ({ params: { locale } }: { params: { locale: string } }) => { - {/* {showCarousel ? ( */} {slides} - {/* ) : ( */} {slides.map((slide, i) => ( @@ -123,10 +125,14 @@ const Page = async ({ params: { locale } }: { params: { locale: string } }) => { ))} - {/* )} */} ) } export default Page +type PageProps = { + params: { + locale: string + } +}