Complete redo of content indexing and querying (#517)
Complete redo of data store Introduces live queries and live templates
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { CompleteEvent } from "$sb/app_event.ts";
|
||||
import { space } from "$sb/syscalls.ts";
|
||||
import { PageMeta } from "../../web/types.ts";
|
||||
import { PageMeta } from "$sb/types.ts";
|
||||
import { cacheFileListing } from "../federation/federation.ts";
|
||||
|
||||
// Completion
|
||||
|
||||
@@ -57,7 +57,7 @@ export async function titleUnfurl(url: string): Promise<string> {
|
||||
const response = await fetch(url);
|
||||
if (response.status < 200 || response.status >= 300) {
|
||||
console.error("Unfurl failed", await response.text());
|
||||
throw new Error(`Failed to fetch: ${await response.statusText}`);
|
||||
throw new Error(`Failed to fetch: ${response.statusText}`);
|
||||
}
|
||||
const body = await response.text();
|
||||
const match = titleRegex.exec(body);
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
import type { CompleteEvent } from "$sb/app_event.ts";
|
||||
import { editor, space } from "$sb/syscalls.ts";
|
||||
|
||||
import { cacheFileListing } from "../federation/federation.ts";
|
||||
import type { PageMeta } from "../../web/types.ts";
|
||||
|
||||
export async function deletePage() {
|
||||
const pageName = await editor.getCurrentPage();
|
||||
if (
|
||||
|
||||
+4
-4
@@ -1,11 +1,11 @@
|
||||
import { readCodeBlockPage } from "$sb/lib/yaml_page.ts";
|
||||
import { editor, store } from "$sb/syscalls.ts";
|
||||
import { clientStore, editor } from "$sb/syscalls.ts";
|
||||
|
||||
export async function toggleVimMode() {
|
||||
let vimMode = await store.get("vimMode");
|
||||
let vimMode = await clientStore.get("vimMode");
|
||||
vimMode = !vimMode;
|
||||
await editor.setUiOption("vimMode", vimMode);
|
||||
await store.set("vimMode", vimMode);
|
||||
await clientStore.set("vimMode", vimMode);
|
||||
}
|
||||
|
||||
export async function loadVimRc() {
|
||||
@@ -28,7 +28,7 @@ export async function loadVimRc() {
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e: any) {
|
||||
} catch {
|
||||
// No VIMRC page found
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user