feat(seo): crawlable card links, listing metadata, similar prefetch

Following links reached only 37 of 1873 urls and the frontier was exhausted
at depth 3, because detail pages rendered no internal links server side.

- Prefetch similar shows on detail pages so their links land in the ssr html.
  Crawl reach goes from 37 pages to 782 and keeps growing. Credits are left
  client side on purpose: dehydrating aggregate_credits pushed a series page
  from 52kb to 600kb to surface only ten person links.
- Replace the aria-label on poster links with sr-only text, so the anchors
  carry real anchor text instead of being empty. Text content is also a
  better accessible name than aria-label.
- Give popular and top their own openGraph and twitter tags. They inherited
  the generic homepage title and description.
- Add og:image:alt on movie, tv and person pages.
- Add ItemList json-ld to the listing pages.
- Drop favorites, watchlist and opengraph-image from the sitemap, and remove
  the robots.txt disallow that kept crawlers from reading their noindex.
- Raise detail revalidate to a week. Cast and release dates barely move, and
  it cuts regenerations, isr writes and origin transfer sevenfold now that
  more pages get crawled.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
nerandClaude Opus 5 committed 2026-08-14 11:23:00 +03:00
1 parent 01792a9669
commit 0186c793f2
9 files changed
+87 -22

No files matched your search

+29 -5
View File
@@ -1,26 +1,50 @@
import { dehydrate, HydrationBoundary } from '@tanstack/react-query';
import { Metadata } from 'next';
import JsonLd from '@/components/JsonLd';
import popularQuery from '@/data/queries/popular';
import { TITLE } from '@/env';
import { itemList } from '@/lib/jsonLd';
import getQueryClient from '@/lib/queryClient';
import Container from './container';
const HEADING = 'Popular Movies';
const DESCRIPTION = `Check out the most popular movies right now on ${TITLE}. See what’s trending and don’t miss out on the latest hits.`;
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.`,
alternates: { canonical: '/popular' }
title: `${HEADING} | ${TITLE}`,
description: DESCRIPTION,
alternates: { canonical: '/popular' },
openGraph: {
type: 'website',
siteName: TITLE,
title: HEADING,
description: DESCRIPTION,
url: '/popular'
},
twitter: {
title: HEADING,
description: DESCRIPTION
}
};
const Popular = async () => {
const queryClient = getQueryClient();
await queryClient.prefetchInfiniteQuery(popularQuery());
const query = popularQuery();
await queryClient.prefetchInfiniteQuery(query);
const shows = queryClient
.getQueryData<{ pages: Pagination<Show>[] }>(query.queryKey)
?.pages.flatMap(({ results }) => results);
return (
<HydrationBoundary state={dehydrate(queryClient)}>
<h1 className='sr-only'>Popular Movies</h1>
{Boolean(shows?.length) && <JsonLd data={itemList(shows!)} />}
<h1 className='sr-only'>{HEADING}</h1>
<Container />
</HydrationBoundary>
);