Add documentation and change settings for Staff Access Tokens

This commit is contained in:
Southpaw
2024-01-19 21:47:08 +00:00
parent 807c33e6ad
commit 470499a8de
4 changed files with 22 additions and 16 deletions

View File

@@ -1,15 +1,21 @@
# Send to Ghost
A maintained fork of Jay Nguyen's [obsidian-ghost-publish](https://github.com/jaynguyens/obsidian-ghost-publish). It allows you to send Obsidian notes to the [Ghost](https://ghost.org) blogging platform, either as published or draft posts.
A maintained fork of Jay Nguyen's [obsidian-ghost-publish](https://github.com/jaynguyens/obsidian-ghost-publish). It allows you to send Obsidian notes to the [Ghost](https://ghost.org) blogging software, either as published or draft posts.
## Usage
- In Ghost, create a new Custom Integration following [this guide](https://ghost.org/integrations/custom-integrations/). You will need the **Admin API Key** and the **API URL** later.
- Install and enable the plugin
- In the plugin settings, fill in the API URL and Admin API Key from the Custom Integration you created earlier.
- You can now publish documents by clicking the little ghost in the sidebar, or by using the command pallete.
### Authentication
Send to Ghost can use either a **Staff Access Token** or an **[Admin API Key](https://ghost.org/integrations/custom-integrations/)**. Each staff member has their own Staff Access Token which gives Send to Ghost permission to do all the things that they can do, while an Admin API Key must be created manually and gives all permissions. Because Obsidian plugins [can't store sensitive information securely](https://forum.obsidian.md/t/a-place-for-plugins-sensitive-data/18308), you should use a Staff Access Token, since its access is more limited. You could also consider creating a seperate staff user with barebones permissions for uploading posts if you are concerned about the security of your site.
## Front Matter format
Note that the Staff Access Tokens of users who have Administrator or Owner permissions have the same access as Admin API Keys. They are still preferred, since their access to your site is tied to the access of the staff member who they belong to. They are also usable with Starter sites on Ghost Pro.
#### Finding your Access Token
To get your Staff Access Token, go to the admin dashboard and click the avatar in the bottom-right corner, then click "Your Profile". Scroll down to find the token, hover over it and click the "copy" button to copy it to the clipboard.
### Using the plugin
After installing the plugin in Obsidian, go to its settings and fill in the fields. Put the URL of your Ghost site in the "Site URL" field, and your Staff Access Token/Admin API Key in the "Access Token" field. You can now click the ghost icon in the ribbon menu on the left or use the "Send to Ghost" command in the command pallete to send the currently open note to Ghost.
### Front Matter format
Send to Ghost uses front matter to set Ghost-specific settings such as the title, tags, and the featured image. You can add front matter by enclosing it in `---` at the beginning of a note.
@@ -28,7 +34,7 @@ feature_image: String (default: blank)
---
```
### Development
## Development
This plugin uses PNPM for dependency management.
@@ -36,11 +42,11 @@ This plugin uses PNPM for dependency management.
- Run `pnpm i` to install the necessary dependencies
- Run `pnpm dev` to automaticlly recompile as the project files change.
### Manual installation
## Manual installation
- Run `pnpm build`
- Copy `main.js` and `manifest.json` to `VaultFolder/.obsidian/plugins/send-to-ghost/` where `Vaultfolder` is the location of your Obsidian vault.
### Issues & Support
## Issues & Support
If you find a bug, please submit an [issue](https://github.com/Southpaw1496/obsidian-send-to-ghost). Otherwise, please contact me via [my website](https://southpaw1496.me).

View File

@@ -1,7 +1,7 @@
{
"id": "send-to-ghost",
"name": "Send to Ghost",
"version": "1.0.3",
"version": "1.0.4",
"minAppVersion": "0.12.0",
"description": "Send and publish notes to your Ghost blog with a single click",
"author": "Southpaw1496",

View File

@@ -1,6 +1,6 @@
{
"name": "obsidian-ghost-publish",
"version": "1.3.0",
"version": "1.0.4",
"description": "Obsidian plugin for easy publish to ghost with a single click.",
"main": "src/main.ts",
"scripts": {

View File

@@ -19,15 +19,15 @@ export class SettingTab extends PluginSettingTab {
document.createEl("a", {
attr: {
href: "https://github.com/Southpaw1496/obsidian-send-to-ghost/blob/master/README.md",
href: "https://github.com/Southpaw1496/obsidian-send-to-ghost#usage",
},
text: "the documentation",
});
new Setting(containerEl)
.setName("API URL")
.setName("Site URL")
.setDesc(
"Your Ghost integration's API URL. Make sure to include https:// at the beginning"
"The URL of your Ghost site. Make sure to include https:// at the beginning"
)
.addText((text) =>
text
@@ -40,8 +40,8 @@ export class SettingTab extends PluginSettingTab {
);
new Setting(containerEl)
.setName("Admin API Key")
.setDesc("Your Ghost integration's Admin API Key")
.setName("Access Token")
.setDesc("Your Staff Access Token or Admin API Key")
.addText((text) =>
text
.setPlaceholder("6251555c94ca6")