Preparing for an initial release

This commit is contained in:
Zef Hemel
2022-06-28 14:14:15 +02:00
parent be92bf2311
commit 16fcd91d6c
73 changed files with 3205 additions and 20734 deletions
-7
View File
@@ -1,12 +1,5 @@
name: ghost
functions:
downloadAllPostsCommand:
path: "./ghost.ts:downloadAllPostsCommand"
command:
name: "Ghost: Download Posts"
downloadAllPosts:
path: "./ghost.ts:downloadAllPosts"
env: server
publishCommand:
path: "./ghost.ts:publishCommand"
command:
+1 -19
View File
@@ -1,7 +1,4 @@
import {
readPage,
writePage,
} from "@silverbulletmd/plugos-silverbullet-syscall/space";
import { readPage } from "@silverbulletmd/plugos-silverbullet-syscall/space";
import { invokeFunction } from "@silverbulletmd/plugos-silverbullet-syscall/system";
import {
getCurrentPage,
@@ -195,21 +192,6 @@ async function getConfig(): Promise<GhostConfig> {
return pageMeta as GhostConfig;
}
export async function downloadAllPostsCommand() {
await invokeFunction("server", "downloadAllPosts");
}
export async function downloadAllPosts() {
let config = await getConfig();
let admin = new GhostAdmin(config.url, config.adminKey);
await admin.init();
let allPosts = await admin.listMarkdownPosts();
for (let post of allPosts) {
let text = mobileDocToMarkdown(post.mobiledoc);
text = `# ${post.title}\n${text}`;
await writePage(`${config.postPrefix}/${post.slug}`, text);
}
}
export async function publishCommand() {
await invokeFunction(
"server",