Content auto pulling, git pull link fix and cleaning console.log/console.time.

This commit is contained in:
Clément Pons
2025-10-28 16:45:35 +01:00
parent ab36eec4de
commit 1c3211d28e
8 changed files with 27 additions and 23 deletions

View File

@@ -14,8 +14,6 @@ export default defineEventHandler(async (e) => {
setResponseStatus(e, 401);
return;
}
console.log(id);
setResponseStatus(e, 200);
return {};

View File

@@ -14,9 +14,6 @@ export default defineEventHandler(async (e) => {
setResponseStatus(e, 401);
return;
}
console.log(id);
console.log(await readBody(e));
setResponseStatus(e, 200);
return;

View File

@@ -91,7 +91,7 @@ export default defineTask({
function reshapeLinks(content: string | null, all: ProjectContent[])
{
return content?.replace(/\[\[(.*?)?(#.*?)?(\|.*?)?\]\]/g, (str, link, header, title) => {
return `[[${link ? parsePath(all.find(e => e.path.endsWith(parsePath(link)))?.path ?? parsePath(link)) : ''}${header ?? ''}${title ?? ''}]]`;
return `[[${link ? parsePath(all.findLast(e => e.path.endsWith(parsePath(link)))?.path ?? parsePath(link)) : ''}${header ?? ''}${title ?? ''}]]`;
});
}