Moved to next js ssr
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import type { Metadata } from 'next';
|
||||
import ModPageClient from '@/components/pages/ModPageClient';
|
||||
import { getMod } from '@/lib/api-server';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
interface Props {
|
||||
params: { modId: string };
|
||||
}
|
||||
|
||||
export async function generateMetadata({ params }: Props): Promise<Metadata> {
|
||||
const mod = await getMod(params.modId);
|
||||
if (!mod) {
|
||||
return { title: 'Mod' };
|
||||
}
|
||||
const title = `${mod.name} (${mod.version})`;
|
||||
const description = `Dawn of War wiki. ${mod.name} mod. Units, races, buildings and stats.`;
|
||||
return {
|
||||
title,
|
||||
description,
|
||||
alternates: {
|
||||
canonical: `/mod/${params.modId}`,
|
||||
},
|
||||
openGraph: {
|
||||
title,
|
||||
description,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default function ModPage() {
|
||||
return <ModPageClient />;
|
||||
}
|
||||
Reference in New Issue
Block a user