feat(seo): slugged show urls, sr-only homepage intro, ISR detail pages

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
nerandClaude Fable 5 committed 2026-08-07 17:46:01 +03:00
1 parent ce630cd029
commit 735c63471a
11 files changed
+103 -28

No files matched your search

+18
View File
@@ -3,6 +3,24 @@ import { twMerge } from 'tailwind-merge';
export const cn = (...inputs: ClassValue[]) => twMerge(clsx(inputs));
export const slugify = (value: string) =>
value
.toLowerCase()
.normalize('NFKD')
.replace(/[̀-ͯ]/g, '')
.replace(/[^a-z0-9]+/g, '-')
.replace(/^-+|-+$/g, '')
.slice(0, 60)
.replace(/-+$/, '');
// Keyword-carrying show URL (/movie/27205-inception); the slug is optional decoration —
// routing only relies on the leading numeric id.
export const showPath = ({ type, id, title }: Pick<Show, 'type' | 'id' | 'title'>) => {
const slug = slugify(title || '');
return `/${type}/${id}${slug ? `-${slug}` : ''}`;
};
export const formatDate = (date: string) =>
new Intl.DateTimeFormat('en-GB', { day: '2-digit', month: '2-digit', year: 'numeric', timeZone: 'UTC' })
.format(new Date(date))