Maj taxonomies
Some checks failed
Build and Push App / build (push) Failing after 11m28s

maj url photo
+ page 404
+ gestion programmation d'article
This commit is contained in:
2026-05-03 21:22:12 +02:00
parent 0e72867d4c
commit 5f421b418e
41 changed files with 1946 additions and 735 deletions

View File

@@ -62,6 +62,10 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
// 3. Fetch all blog posts
const blogPosts = await prisma.blogPost.findMany({
where: {
status: 'PUBLISHED',
publishedAt: { lte: new Date() }
},
select: { id: true, slug: true, updatedAt: true },
});
@@ -74,6 +78,10 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
// 4. Fetch all Afro Life (Interviews)
const interviews = await prisma.interview.findMany({
where: {
status: 'PUBLISHED',
publishedAt: { lte: new Date() }
},
select: { id: true, slug: true, updatedAt: true },
});
@@ -84,7 +92,23 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
priority: 0.7,
}));
return [...staticRoutes, ...businessRoutes, ...blogRoutes, ...afroLifeRoutes];
// 5. Fetch all Events
const events = await prisma.event.findMany({
where: {
status: 'PUBLISHED',
publishedAt: { lte: new Date() }
},
select: { id: true, slug: true, updatedAt: true },
});
const eventRoutes = events.map((event) => ({
url: `${baseUrl}/afrolife/${event.slug || event.id}`,
lastModified: event.updatedAt,
changeFrequency: 'monthly' as const,
priority: 0.7,
}));
return [...staticRoutes, ...businessRoutes, ...blogRoutes, ...afroLifeRoutes, ...eventRoutes];
} catch (error) {
console.error("Error generating sitemap:", error);
// Fallback to only static routes if DB connection fails