From f08d065cb171fa6b3113c0fcb9286f392b119586 Mon Sep 17 00:00:00 2001 From: GauthierWebDev Date: Tue, 22 Apr 2025 13:26:12 +0200 Subject: [PATCH] style: Update margin in LatestDocs section --- app/partials/LatestDocs.tsx | 2 +- app/services/DocCache.ts | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/app/partials/LatestDocs.tsx b/app/partials/LatestDocs.tsx index 8de1d6e..f1ae701 100644 --- a/app/partials/LatestDocs.tsx +++ b/app/partials/LatestDocs.tsx @@ -8,7 +8,7 @@ export function LatestDocs() { const data = useData(); return ( -
+

Dernières documentations

diff --git a/app/services/DocCache.ts b/app/services/DocCache.ts index 8e45005..6153a5f 100644 --- a/app/services/DocCache.ts +++ b/app/services/DocCache.ts @@ -263,7 +263,7 @@ class DocCache { const checkIfExcludedFileNames = (doc: SectionCache) => { if (config.excludedFileNames.length > 0) { return !config.excludedFileNames.some((fileName) => { - return doc.filePath.includes(fileName); + return doc.filePath === fileName; }); } @@ -273,12 +273,24 @@ class DocCache { const sortedDocs = Array.from(this.cache.values()) .sort((a, b) => b.lastEdit.getTime() - a.lastEdit.getTime()) .filter((doc) => { - return [ + const isIncluded = [ checkIfIncludedBasePath(doc), checkIfExcludedBasePaths(doc), checkIfIncludedFileNames(doc), checkIfExcludedFileNames(doc), ].every((check) => check === true); + + // DEBUG + // if (!isIncluded) { + // console.group(doc.filePath); + // console.log("includedBasePaths", checkIfIncludedBasePath(doc)); + // console.log("excludedBasePaths", checkIfExcludedBasePaths(doc)); + // console.log("includedFileNames", checkIfIncludedFileNames(doc)); + // console.log("excludedFileNames", checkIfExcludedFileNames(doc)); + // console.groupEnd(); + // } + + return isIncluded; }); if (config.limit > 0) return sortedDocs.slice(0, config.limit);