Federation: rewrite page references in federated content
This commit is contained in:
+4
-1
@@ -24,6 +24,7 @@ import {
|
||||
import { applyQuery, removeQueries } from "$sb/lib/query.ts";
|
||||
import { niceDate } from "$sb/lib/dates.ts";
|
||||
import { extractAttributes } from "$sb/lib/attribute.ts";
|
||||
import { rewritePageRefs } from "$sb/lib/resolve.ts";
|
||||
|
||||
export type Task = {
|
||||
name: string;
|
||||
@@ -54,6 +55,8 @@ export async function indexTasks({ name, tree }: IndexTreeEvent) {
|
||||
done: complete,
|
||||
};
|
||||
|
||||
rewritePageRefs(n, name);
|
||||
|
||||
replaceNodesMatching(n, (tree) => {
|
||||
if (tree.type === "DeadlineDate") {
|
||||
task.deadline = getDeadline(tree);
|
||||
@@ -91,7 +94,7 @@ export async function indexTasks({ name, tree }: IndexTreeEvent) {
|
||||
return true;
|
||||
});
|
||||
|
||||
// console.log("Found", tasks.length, "task(s)");
|
||||
// console.log("Found", tasks, "task(s)");
|
||||
await index.batchSet(name, tasks);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user