We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5da1812 commit 9307d44Copy full SHA for 9307d44
src/app/[locale]/(main)/products/[...id]/page.tsx
@@ -17,7 +17,6 @@ import {
17
} from '@mui/material';
18
import { grey } from '@mui/material/colors';
19
import type { Metadata } from 'next';
20
-import { headers } from 'next/headers';
21
import { useTranslations } from 'next-intl';
22
23
type PageProps = {
@@ -30,13 +29,11 @@ export async function generateMetadata({
30
29
params,
31
}: PageProps): Promise<Metadata> {
32
const id = params.id;
33
- const url = new URL(headers().get('x-url')!);
34
- const slug = title.replaceAll(' ', '-');
35
36
return {
37
title,
38
alternates: {
39
- canonical: `${url.origin}/products/${id}/${slug}`,
+ canonical: '',
40
},
41
};
42
}
0 commit comments