404
All checks were successful
Build & Deploy KLZ Cables / build-and-deploy (push) Successful in 3m48s
All checks were successful
Build & Deploy KLZ Cables / build-and-deploy (push) Successful in 3m48s
This commit is contained in:
@@ -5,7 +5,7 @@ import { getTranslations } from 'next-intl/server';
|
||||
import { Metadata } from 'next';
|
||||
import { getPageBySlug, getAllPages } from '@/lib/pages';
|
||||
import { mdxComponents } from '@/components/blog/MDXComponents';
|
||||
import { mapFileSlugToTranslated } from '@/lib/slugs';
|
||||
|
||||
interface PageProps {
|
||||
params: {
|
||||
locale: string;
|
||||
@@ -13,6 +13,19 @@ interface PageProps {
|
||||
};
|
||||
}
|
||||
|
||||
export async function generateStaticParams() {
|
||||
const locales = ['en', 'de'];
|
||||
const params = [];
|
||||
|
||||
for (const locale of locales) {
|
||||
const pages = await getAllPages(locale);
|
||||
for (const page of pages) {
|
||||
params.push({ locale, slug: page.slug });
|
||||
}
|
||||
}
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
export async function generateMetadata({ params: { locale, slug } }: PageProps): Promise<Metadata> {
|
||||
const pageData = await getPageBySlug(slug, locale);
|
||||
@@ -50,7 +63,6 @@ export default async function StandardPage({ params: { locale, slug } }: PagePro
|
||||
if (!pageData) {
|
||||
notFound();
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<div className="flex flex-col min-h-screen bg-white">
|
||||
@@ -102,18 +114,4 @@ export default async function StandardPage({ params: { locale, slug } }: PagePro
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export async function generateStaticParams() {
|
||||
const locales = ['en', 'de'];
|
||||
const params = [];
|
||||
|
||||
for (const locale of locales) {
|
||||
const pages = await getAllPages(locale);
|
||||
for (const page of pages) {
|
||||
params.push({ locale, slug: page.slug });
|
||||
}
|
||||
}
|
||||
|
||||
return params;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user