refactor: apply consistent formatting to improve code quality
Some checks failed
Deploy to Production / deploy (push) Failing after 2m20s
Lint / lint (push) Successful in 9m37s

Ensure uniform code formatting across components by aligning with the established code style. Adjust imports, indentation, and spacing to enhance readability and maintainability.
This commit is contained in:
Mathis HERRIOT
2026-01-14 17:26:58 +01:00
parent 03e5915fcc
commit 35abd0496e
95 changed files with 6839 additions and 6659 deletions

View File

@@ -1,45 +1,47 @@
import type { MetadataRoute } from "next";
import { ContentService } from "@/services/content.service";
import { CategoryService } from "@/services/category.service";
import { ContentService } from "@/services/content.service";
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
const baseUrl = process.env.NEXT_PUBLIC_APP_URL || "https://memegoat.local";
const baseUrl = process.env.NEXT_PUBLIC_APP_URL || "https://memegoat.local";
// Pages statiques
const routes: MetadataRoute.Sitemap = ["", "/trends", "/recent"].map((route) => ({
url: `${baseUrl}${route}`,
lastModified: new Date(),
changeFrequency: "daily" as const,
priority: route === "" ? 1 : 0.8,
}));
// Pages statiques
const routes: MetadataRoute.Sitemap = ["", "/trends", "/recent"].map(
(route) => ({
url: `${baseUrl}${route}`,
lastModified: new Date(),
changeFrequency: "daily" as const,
priority: route === "" ? 1 : 0.8,
}),
);
// Catégories
try {
const categories = await CategoryService.getAll();
const categoryRoutes = categories.map((category) => ({
url: `${baseUrl}/category/${category.slug}`,
lastModified: new Date(),
changeFrequency: "weekly" as const,
priority: 0.6,
}));
routes.push(...categoryRoutes);
} catch (error) {
console.error("Sitemap: Failed to fetch categories");
}
// Catégories
try {
const categories = await CategoryService.getAll();
const categoryRoutes = categories.map((category) => ({
url: `${baseUrl}/category/${category.slug}`,
lastModified: new Date(),
changeFrequency: "weekly" as const,
priority: 0.6,
}));
routes.push(...categoryRoutes);
} catch (_error) {
console.error("Sitemap: Failed to fetch categories");
}
// Mèmes (limité aux 100 derniers pour éviter un sitemap trop gros d'un coup)
try {
const contents = await ContentService.getRecent(100, 0);
const memeRoutes = contents.data.map((meme) => ({
url: `${baseUrl}/meme/${meme.slug}`,
lastModified: new Date(meme.updatedAt),
changeFrequency: "monthly" as const,
priority: 0.5,
}));
routes.push(...memeRoutes);
} catch (error) {
console.error("Sitemap: Failed to fetch memes");
}
// Mèmes (limité aux 100 derniers pour éviter un sitemap trop gros d'un coup)
try {
const contents = await ContentService.getRecent(100, 0);
const memeRoutes = contents.data.map((meme) => ({
url: `${baseUrl}/meme/${meme.slug}`,
lastModified: new Date(meme.updatedAt),
changeFrequency: "monthly" as const,
priority: 0.5,
}));
routes.push(...memeRoutes);
} catch (_error) {
console.error("Sitemap: Failed to fetch memes");
}
return routes;
return routes;
}