seo/sitemap #18
@ -8,7 +8,7 @@ export function LatestDocs() {
|
|||||||
const data = useData<Data>();
|
const data = useData<Data>();
|
||||||
|
|
||||||
return (
|
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">
|
<h2 class="font-display text-3xl tracking-tight text-slate-900 text-center">
|
||||||
Dernières documentations
|
Dernières documentations
|
||||||
</h2>
|
</h2>
|
||||||
|
|||||||
@ -263,7 +263,7 @@ class DocCache {
|
|||||||
const checkIfExcludedFileNames = (doc: SectionCache) => {
|
const checkIfExcludedFileNames = (doc: SectionCache) => {
|
||||||
if (config.excludedFileNames.length > 0) {
|
if (config.excludedFileNames.length > 0) {
|
||||||
return !config.excludedFileNames.some((fileName) => {
|
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())
|
const sortedDocs = Array.from(this.cache.values())
|
||||||
.sort((a, b) => b.lastEdit.getTime() - a.lastEdit.getTime())
|
.sort((a, b) => b.lastEdit.getTime() - a.lastEdit.getTime())
|
||||||
.filter((doc) => {
|
.filter((doc) => {
|
||||||
return [
|
const isIncluded = [
|
||||||
checkIfIncludedBasePath(doc),
|
checkIfIncludedBasePath(doc),
|
||||||
checkIfExcludedBasePaths(doc),
|
checkIfExcludedBasePaths(doc),
|
||||||
checkIfIncludedFileNames(doc),
|
checkIfIncludedFileNames(doc),
|
||||||
checkIfExcludedFileNames(doc),
|
checkIfExcludedFileNames(doc),
|
||||||
].every((check) => check === true);
|
].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);
|
if (config.limit > 0) return sortedDocs.slice(0, config.limit);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user