From 9c0525e68324186ea67c1e54e425efa8e432dc27 Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Sun, 15 Jan 2023 13:48:43 +0100 Subject: [PATCH] Ghost plug doc update --- plugs/core/plugmanager.ts | 2 -- website/🔌 Ghost.md | 36 ++++++++++++++++++++++++++---------- website/🔌 Share.md | 1 + 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/plugs/core/plugmanager.ts b/plugs/core/plugmanager.ts index 13a14f0..9428e85 100644 --- a/plugs/core/plugmanager.ts +++ b/plugs/core/plugmanager.ts @@ -91,9 +91,7 @@ export async function updatePlugs() { "_plug/".length, existingPlug.length - ".plug.json".length, ); - // console.log("Considering", plugName); if (!allPlugNames.includes(plugName)) { - // console.log("Removing plug", plugName); await space.deleteAttachment(existingPlug); } } diff --git a/website/🔌 Ghost.md b/website/🔌 Ghost.md index a83cd14..7f8cf28 100644 --- a/website/🔌 Ghost.md +++ b/website/🔌 Ghost.md @@ -3,32 +3,48 @@ type: plug uri: github:silverbulletmd/silverbullet-ghost/ghost.plug.json repo: https://github.com/silverbulletmd/silverbullet-ghost author: Zef Hemel +share-support: true --- -**Note:** Currently in broken state, needs updating. - # Ghost plug for Silver Bullet -Note: Still very basic, to use: +This allows you to publish your pages as [Ghost](https://ghost.org/) pages or posts. I use it to publish [Zef+](https://zef.plus). +## Configuration In your `SETTINGS` specify the following settings: ```yaml - ghostUrl: https://your-ghost-blog.ghost.io - ghostPostPrefix: posts - ghostPagePrefix: pages + ghost: + myblog: + url: https://your-ghost-blog.ghost.io ``` -And in your `SECRETS` file: +Then, create a Custom Integration (in your Ghost control panel under Settings > Advanced > Integrations > Add Custom Integration). Enter a name (whatever you want), then copy the full Admin API Key in your `SECRETS` file, mirroring the structure of SETTINGS: ```yaml - ghostAdminKey: your:adminkey + ghost: + myblog: your:adminkey ``` -This will assume the naming pattern of `posts/my-post-slug` where the first top-level heading (`# Hello`) will be used as the post title. +## Usage +The plugin hooks into Silver Bullet's [Share infrastructure](https://silverbullet.md/%F0%9F%94%8C_Share). Therefore to share a page as either a Ghost page or post, add a `$share` front matter key. For posts this should take the shape of: -Commands to use `Ghost: Publish` + --- + $share: + - ghost:myblog:post:my-post-slug + --- + +And for pages: + + --- + $share: + - ghost:myblog:page:my-page-slug + --- + +Now, when you {[Share: Publish]} (Cmd-s/Ctrl-s) your post will automatically be created (as a draft) or updated if it already exists. + +Enjoy! ## Installation Open your `PLUGS` note in SilverBullet and add this plug to the list: diff --git a/website/🔌 Share.md b/website/🔌 Share.md index a689367..4867ba1 100644 --- a/website/🔌 Share.md +++ b/website/🔌 Share.md @@ -9,6 +9,7 @@ See the [original RFC](https://github.com/silverbulletmd/silverbullet/discussion Specific implementations for sharing are implemented in other plugs, specifically: +* [[🔌 Ghost]] * [[🔌 Markdown]] * [[🔌 Collab]] * [[🔌 Mattermost]]