mirror of
https://github.com/fmhy/edit.git
synced 2026-02-19 01:31:41 +11:00
lets just save it
This commit is contained in:
parent
d045dc6462
commit
5e82944199
1 changed files with 4 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import { defineLoader } from "vitepress";
|
||||
import { writeFile, readFile } from "fs/promises";
|
||||
|
||||
interface Data {
|
||||
title?: string;
|
||||
|
|
@ -36,8 +37,10 @@ export default defineLoader({
|
|||
guides.add({ title, url });
|
||||
}
|
||||
}
|
||||
return Object.fromEntries(
|
||||
const obj = Object.fromEntries(
|
||||
[...guides.entries()].map((entry, index) => [index.toString(), entry]),
|
||||
);
|
||||
await writeFile("./guides.json",JSON.stringify(obj, null, 4), "")
|
||||
return await readFile("./guides.json", { encoding: "utf-8"})
|
||||
},
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue