Don't index templates during full space reindex
parent
35e2afc18b
commit
b359d9e065
|
@ -35,24 +35,34 @@ export async function processIndexQueue(messages: MQMessage[]) {
|
||||||
console.log(`Indexing page ${name}`);
|
console.log(`Indexing page ${name}`);
|
||||||
const text = await space.readPage(name);
|
const text = await space.readPage(name);
|
||||||
const parsed = await markdown.parseMarkdown(text);
|
const parsed = await markdown.parseMarkdown(text);
|
||||||
|
if (isTemplate(text)) {
|
||||||
|
console.log("Indexing", name, "as template");
|
||||||
|
await events.dispatchEvent("page:indexTemplate", {
|
||||||
|
name,
|
||||||
|
tree: parsed,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
await events.dispatchEvent("page:index", {
|
||||||
|
name,
|
||||||
|
tree: parsed,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function parseIndexTextRepublish({ name, text }: IndexEvent) {
|
||||||
|
const parsed = await markdown.parseMarkdown(text);
|
||||||
|
|
||||||
|
if (isTemplate(text)) {
|
||||||
|
console.log("Indexing", name, "as template");
|
||||||
|
await events.dispatchEvent("page:indexTemplate", {
|
||||||
|
name,
|
||||||
|
tree: parsed,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
await events.dispatchEvent("page:index", {
|
await events.dispatchEvent("page:index", {
|
||||||
name,
|
name,
|
||||||
tree: parsed,
|
tree: parsed,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function parseIndexTextRepublish({ name, text }: IndexEvent) {
|
|
||||||
if (isTemplate(text)) {
|
|
||||||
console.log("Indexing", name, "as template");
|
|
||||||
await events.dispatchEvent("page:indexTemplate", {
|
|
||||||
name,
|
|
||||||
tree: await markdown.parseMarkdown(text),
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
await events.dispatchEvent("page:index", {
|
|
||||||
name,
|
|
||||||
tree: await markdown.parseMarkdown(text),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue