fix(seo): bypass TS typecheck for experimental htmlLimitedBots flag
This commit is contained in:
@@ -42,6 +42,10 @@ const nextConfig: NextConfig = {
|
||||
turbopack: {
|
||||
root: path.resolve(dirname),
|
||||
},
|
||||
experimental: {
|
||||
// @ts-expect-error - Undocumented Next.js feature required for SEO streaming
|
||||
htmlLimitedBots: /Googlebot|bingbot|yandex|baiduspider/i,
|
||||
},
|
||||
}
|
||||
|
||||
export default withPayload(nextConfig, { devBundleServerPackages: false })
|
||||
|
||||
@@ -20,6 +20,37 @@ const pageMetadata = createPageMetadata({
|
||||
baseUrl: process.env.NEXT_PUBLIC_SERVER_URL || 'https://www.jkedzierski.de'
|
||||
})
|
||||
|
||||
export const revalidate = 3600
|
||||
|
||||
export async function generateStaticParams() {
|
||||
const payload = await getPayload({ config: configPromise })
|
||||
const pages = await payload.find({ collection: 'pages', limit: 1000 })
|
||||
const params: { locale: string; slug: string[] }[] = []
|
||||
|
||||
for (const page of pages.docs) {
|
||||
if (page.slug && typeof page.slug === 'object') {
|
||||
for (const [locale, slug] of Object.entries(page.slug)) {
|
||||
if (slug && typeof slug === 'string') {
|
||||
// Assuming index page is just the locale root without slug
|
||||
params.push({
|
||||
locale,
|
||||
slug: slug === 'home' ? [] : slug.split('/')
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// fallback to empty slugs for languages if none matched
|
||||
if (params.length === 0) {
|
||||
params.push({ locale: 'pl', slug: [] })
|
||||
params.push({ locale: 'en', slug: [] })
|
||||
params.push({ locale: 'de', slug: [] })
|
||||
}
|
||||
|
||||
return params
|
||||
}
|
||||
|
||||
export async function generateMetadata(
|
||||
props: { params: Promise<{ locale: string; slug?: string[] }> }
|
||||
): Promise<Metadata> {
|
||||
|
||||
@@ -68,13 +68,11 @@ export default async function RootLayout(props: {
|
||||
|
||||
return (
|
||||
<html lang={locale} suppressHydrationWarning className={`${publicSans.variable} ${fraunces.variable}`}>
|
||||
<head>
|
||||
<body className="font-sans antialiased bg-background text-foreground min-h-screen flex flex-col">
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{ __html: JSON.stringify(schemaOrg) }}
|
||||
/>
|
||||
</head>
|
||||
<body className="font-sans antialiased bg-background text-foreground min-h-screen flex flex-col">
|
||||
<Providers>
|
||||
<LanguageSlugsProvider>
|
||||
<ConsentProvider texts={consentTexts}>
|
||||
|
||||
Reference in New Issue
Block a user