style: Update margin in LatestDocs section

This commit is contained in:
Gauthier Daniels 2025-04-22 13:26:12 +02:00
parent d02c083898
commit f08d065cb1
2 changed files with 15 additions and 3 deletions

View File

@ -8,7 +8,7 @@ export function LatestDocs() {
const data = useData<Data>();
return (
<section class="bg-violet-200 rounded-md p-4 m-6">
<section class="bg-violet-200 rounded-md p-4 m-4 lg:m-6">
<h2 class="font-display text-3xl tracking-tight text-slate-900 text-center">
Dernières documentations
</h2>

View File

@ -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);