feat(seo): metadata API migration, canonicals, og images

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
nerandClaude Fable 5 committed 2026-08-07 17:02:20 +03:00
1 parent 8b56268430
commit 9b64f137f1
9 files changed
+71 -25

No files matched your search

+2 -1
View File
@@ -6,7 +6,8 @@ import UsersList from '../components/UsersLists';
export const metadata: Metadata = {
title: `My Favorite Shows | ${TITLE}`,
description: `View your favorite shows on ${TITLE}. Keep track of films you’ve added and revisit your top picks anytime.`
description: `View your favorite shows on ${TITLE}. Keep track of films you’ve added and revisit your top picks anytime.`,
robots: { index: false }
};
const Favorites = () => {
+2 -1
View File
@@ -6,7 +6,8 @@ import UsersList from '../components/UsersLists';
export const metadata: Metadata = {
title: `My watchlist | ${TITLE}`,
description: `View your favorite shows on ${TITLE}. Keep track of films you’ve added and revisit your top picks anytime.`
description: `View your favorite shows on ${TITLE}. Keep track of films you’ve added and revisit your top picks anytime.`,
robots: { index: false }
};
const WatchList = async () => {
+5
View File
@@ -1,10 +1,15 @@
import { dehydrate, HydrationBoundary } from '@tanstack/react-query';
import { Metadata } from 'next';
import randomQuery, { generatePage } from '@/data/queries/random';
import getQueryClient from '@/lib/queryClient';
import Container from './container';
export const metadata: Metadata = {
alternates: { canonical: '/' }
};
const Random = async () => {
const queryClient = getQueryClient();
+9 -5
View File
@@ -3,7 +3,7 @@ import { Metadata } from 'next';
import { notFound } from 'next/navigation';
import detailsQuery from '@/data/queries/details';
import { SITE_URL, TITLE } from '@/env';
import { TITLE } from '@/env';
import getQueryClient from '@/lib/queryClient';
import Container from './container';
@@ -18,17 +18,21 @@ export const createShowMetadata =
const queryClient = getQueryClient();
try {
const { title, overview, poster } = await queryClient.fetchQuery(detailsQuery({ showId: Number(id), showType }));
const { title, overview, poster, backdrop } = await queryClient.fetchQuery(
detailsQuery({ showId: Number(id), showType })
);
return {
title: `${title} | ${TITLE}`,
description: overview,
alternates: { canonical: `/${showType}/${id}` },
openGraph: {
title,
description: overview,
images: [poster['2x']],
type: 'website',
url: `${SITE_URL}/${showType}/${id}`
siteName: TITLE,
images: [backdrop || poster['2x']],
type: showType === 'movie' ? 'video.movie' : 'video.tv_show',
url: `/${showType}/${id}`
}
};
} catch (_) {
+4 -2
View File
@@ -5,7 +5,7 @@ import { notFound } from 'next/navigation';
import Person from '@/components/Person';
import personQuery from '@/data/queries/person';
import { SITE_URL, TITLE } from '@/env';
import { TITLE } from '@/env';
import getQueryClient from '@/lib/queryClient';
interface Props {
@@ -23,12 +23,14 @@ export const generateMetadata = async ({ params: { id } }: Props): Promise<Metad
return {
title: `${name} | ${TITLE}`,
description,
alternates: { canonical: `/person/${id}` },
openGraph: {
title: name,
description,
siteName: TITLE,
images: photo ? [photo] : [],
type: 'profile',
url: `${SITE_URL}/person/${id}`
url: `/person/${id}`
}
};
} catch (_) {
+2 -1
View File
@@ -9,7 +9,8 @@ import Container from './container';
export const metadata: Metadata = {
title: `Popular Movies | ${TITLE}`,
description: `Check out the most popular movies right now on ${TITLE}. See what’s trending and don’t miss out on the latest hits.`
description: `Check out the most popular movies right now on ${TITLE}. See what’s trending and don’t miss out on the latest hits.`,
alternates: { canonical: '/popular' }
};
const Popular = async () => {
+2 -1
View File
@@ -9,7 +9,8 @@ import Container from './container';
export const metadata: Metadata = {
title: `Top Rated Movies | ${TITLE}`,
description: `Discover the top-rated movies on ${TITLE}. Find the highest-rated films and make informed viewing choices.`
description: `Discover the top-rated movies on ${TITLE}. Find the highest-rated films and make informed viewing choices.`,
alternates: { canonical: '/top' }
};
const Top = async () => {