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 { Metadata } from 'next';
|
||||||
import { getPageBySlug, getAllPages } from '@/lib/pages';
|
import { getPageBySlug, getAllPages } from '@/lib/pages';
|
||||||
import { mdxComponents } from '@/components/blog/MDXComponents';
|
import { mdxComponents } from '@/components/blog/MDXComponents';
|
||||||
import { mapFileSlugToTranslated } from '@/lib/slugs';
|
|
||||||
interface PageProps {
|
interface PageProps {
|
||||||
params: {
|
params: {
|
||||||
locale: string;
|
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> {
|
export async function generateMetadata({ params: { locale, slug } }: PageProps): Promise<Metadata> {
|
||||||
const pageData = await getPageBySlug(slug, locale);
|
const pageData = await getPageBySlug(slug, locale);
|
||||||
@@ -51,7 +64,6 @@ export default async function StandardPage({ params: { locale, slug } }: PagePro
|
|||||||
notFound();
|
notFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-col min-h-screen bg-white">
|
<div className="flex flex-col min-h-screen bg-white">
|
||||||
{/* Hero Section */}
|
{/* Hero Section */}
|
||||||
@@ -103,17 +115,3 @@ 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