diff --git a/builder/index.ts b/builder/index.ts index 797d719..5500dfb 100644 --- a/builder/index.ts +++ b/builder/index.ts @@ -1,6 +1,7 @@ import { CreateFolderPage, CreatePage } from "./page"; -import { readdir, stat, mkdir } from "fs/promises"; +import { readdir, stat, mkdir, writeFile } from "fs/promises"; import { CreateToolbar } from "./toolbar"; +import * as Search from "./search"; console.info("Building Docs..."); @@ -30,6 +31,9 @@ async function BuildDir(path: string) { await CreateFolderPage(toolbar, path); await Promise.all(folders.map(BuildDir)); + + + writeFile("./public/search.json", Search.Jsonify()); } diff --git a/builder/page.ts b/builder/page.ts index f035037..5e44bc9 100644 --- a/builder/page.ts +++ b/builder/page.ts @@ -1,27 +1,50 @@ import { readFile, writeFile } from "fs/promises"; import { Path2Name, Reroute } from "./helper"; +import { AddIndex } from "./search"; + + +const search = `