Work on $share

This commit is contained in:
Zef Hemel
2022-11-24 12:04:00 +01:00
parent c5c6cd3af0
commit 5b1ec14891
20 changed files with 528 additions and 163 deletions
+2 -2
View File
@@ -21,7 +21,7 @@ import {
replaceNodesMatching,
} from "$sb/lib/tree.ts";
import { applyQuery } from "$sb/lib/query.ts";
import { extractMeta } from "../directive/data.ts";
import { extractFrontmatter } from "$sb/lib/frontmatter.ts";
// Key space:
// pl:toPage:pos => pageName
@@ -31,7 +31,7 @@ export async function indexLinks({ name, tree }: IndexTreeEvent) {
const backLinks: { key: string; value: string }[] = [];
// [[Style Links]]
// console.log("Now indexing", name);
const pageMeta = extractMeta(tree);
const pageMeta = extractFrontmatter(tree);
if (Object.keys(pageMeta).length > 0) {
// console.log("Extracted page meta data", pageMeta);
// Don't index meta data starting with $
+2 -2
View File
@@ -1,5 +1,5 @@
import { editor, markdown, space } from "$sb/silverbullet-syscall/mod.ts";
import { extractMeta } from "../directive/data.ts";
import { extractFrontmatter } from "$sb/lib/frontmatter.ts";
import { renderToText } from "$sb/lib/tree.ts";
import { niceDate } from "$sb/lib/dates.ts";
import { readSettings } from "$sb/lib/settings_page.ts";
@@ -31,7 +31,7 @@ export async function instantiateTemplateCommand() {
);
const parseTree = await markdown.parseMarkdown(text);
const additionalPageMeta = extractMeta(parseTree, [
const additionalPageMeta = extractFrontmatter(parseTree, [
"$name",
"$disableDirectives",
]);