animations

This commit is contained in:
2026-01-17 13:17:10 +01:00
parent 021d23ab93
commit 29168a9778
19 changed files with 1353 additions and 252 deletions

View File

@@ -29,6 +29,27 @@ export async function getProductBySlug(slug: string, locale: string): Promise<Pr
}
if (!fs.existsSync(filePath)) {
// Fallback to English if locale is not 'en'
if (locale !== 'en') {
const enProductsDir = path.join(process.cwd(), 'data', 'products', 'en');
let enFilePath = path.join(enProductsDir, `${slug}.mdx`);
if (!fs.existsSync(enFilePath)) {
enFilePath = path.join(enProductsDir, `${slug}-2.mdx`);
}
if (fs.existsSync(enFilePath)) {
const fileContent = fs.readFileSync(enFilePath, 'utf8');
const { data, content } = matter(fileContent);
return {
slug,
frontmatter: {
...data,
isFallback: true
} as ProductFrontmatter & { isFallback?: boolean },
content,
};
}
}
return null;
}