seo/sitemap #18
@ -37,7 +37,7 @@ QuickLinks.QuickLink = (props: QuickLinkProps) => (
|
||||
<div class="relative overflow-hidden rounded-xl p-6">
|
||||
<Icon icon={props.icon} color="blue" class="h-8 w-8" />
|
||||
|
||||
<h2 class="mt-4 font-display text-base text-slate-900">
|
||||
<h2 class="mt-4 font-display text-base text-slate-900 leading-5">
|
||||
<Link href={props.href}>
|
||||
<span class="absolute -inset-px rounded-xl" />
|
||||
{props.title}
|
||||
@ -45,7 +45,7 @@ QuickLinks.QuickLink = (props: QuickLinkProps) => (
|
||||
</h2>
|
||||
|
||||
{props.lastEdited && (
|
||||
<p class="-mt-2 italic mb-2 text-xs text-slate-500">
|
||||
<p class="mt-2 mb-4 italic text-xs text-slate-500">
|
||||
<span class="font-semibold">Dernière modification :</span>{" "}
|
||||
<time datetime={props.lastEdited.toISOString()}>
|
||||
{props.lastEdited.toLocaleDateString("fr-FR", {
|
||||
|
||||
@ -230,30 +230,55 @@ class DocCache {
|
||||
...customConfig,
|
||||
};
|
||||
|
||||
const sortedDocs = Array.from(this.cache.values())
|
||||
.sort((a, b) => b.lastEdit.getTime() - a.lastEdit.getTime())
|
||||
.filter((doc) => {
|
||||
const checkIfIncludedBasePath = (doc: SectionCache) => {
|
||||
if (config.includedBasePaths.length > 0) {
|
||||
return config.includedBasePaths.some((basePath) => {
|
||||
return doc.filePath.startsWith(basePath);
|
||||
});
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
const checkIfExcludedBasePaths = (doc: SectionCache) => {
|
||||
if (config.excludedBasePaths.length > 0) {
|
||||
return !config.excludedBasePaths.some((basePath) => {
|
||||
return doc.filePath.startsWith(basePath);
|
||||
});
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
const checkIfIncludedFileNames = (doc: SectionCache) => {
|
||||
if (config.includedFileNames.length > 0) {
|
||||
return config.includedFileNames.some((fileName) => {
|
||||
return doc.filePath.includes(fileName);
|
||||
});
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
const checkIfExcludedFileNames = (doc: SectionCache) => {
|
||||
if (config.excludedFileNames.length > 0) {
|
||||
return !config.excludedFileNames.some((fileName) => {
|
||||
return doc.filePath.includes(fileName);
|
||||
});
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
const sortedDocs = Array.from(this.cache.values())
|
||||
.sort((a, b) => b.lastEdit.getTime() - a.lastEdit.getTime())
|
||||
.filter((doc) => {
|
||||
return [
|
||||
checkIfIncludedBasePath(doc),
|
||||
checkIfExcludedBasePaths(doc),
|
||||
checkIfIncludedFileNames(doc),
|
||||
checkIfExcludedFileNames(doc),
|
||||
].every((check) => check === true);
|
||||
});
|
||||
|
||||
if (config.limit > 0) return sortedDocs.slice(0, config.limit);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user