mirror of
https://github.com/d0zingcat/obsidian-send-to-ghost.git
synced 2026-05-13 23:16:49 +00:00
Update some interfaces
This commit is contained in:
@@ -16,7 +16,7 @@ export default class GhostPublish extends Plugin {
|
||||
const view = this.app.workspace.getActiveViewOfType(MarkdownView);
|
||||
if (!view) {
|
||||
new Notice(
|
||||
"Open the markdown file first before publish your post"
|
||||
"You must open the note that you want to send to Ghost."
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -27,11 +27,11 @@ export default class GhostPublish extends Plugin {
|
||||
// 2. Run the by command + P
|
||||
this.addCommand({
|
||||
id: "publish",
|
||||
name: "Publish current document",
|
||||
name: "Send to Ghost",
|
||||
editorCallback: (_, view: MarkdownView) => {
|
||||
if (!view) {
|
||||
new Notice(
|
||||
"Open the markdown file first before publish your post"
|
||||
"You must open the note that you want to send to Ghostt"
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -13,43 +13,30 @@ export class SettingTab extends PluginSettingTab {
|
||||
const { containerEl } = this;
|
||||
|
||||
containerEl.empty();
|
||||
containerEl.createEl("h2", { text: "Obsidian Ghost Publish" });
|
||||
containerEl.createEl("h2", { text: "Send to Ghost" });
|
||||
|
||||
const document = containerEl.createEl("p", {
|
||||
text: `Need help? Take a look on how to use me on `,
|
||||
text: `If you get stuck, please refer to `,
|
||||
});
|
||||
|
||||
document.createEl("a", {
|
||||
attr: {
|
||||
href: "https://github.com/jaynguyens/obsidian-ghost-publish/blob/master/README.md",
|
||||
href: "https://github.com/Southpaw1496/obsidian-send-to-ghost/blob/master/README.md",
|
||||
},
|
||||
text: "the documentation",
|
||||
});
|
||||
|
||||
const donation = containerEl.createEl("p", {
|
||||
text: "You can support future development by ",
|
||||
});
|
||||
|
||||
donation.createEl("a", {
|
||||
attr: {
|
||||
href: "https://www.buymeacoffee.com/jaynguyens",
|
||||
},
|
||||
text: "buy me a coffe ☕️",
|
||||
});
|
||||
|
||||
containerEl.createEl("br");
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName("API URL")
|
||||
.setDesc(
|
||||
"Your full URL e.g: https://obsidian.md. Note, domain.com won't work."
|
||||
"Your Ghost integration's API URL. Make sure to include https:// at the beginning"
|
||||
)
|
||||
.addText((text) =>
|
||||
text
|
||||
.setPlaceholder("https://obsidian.md")
|
||||
.setPlaceholder("https://ghost.org")
|
||||
.setValue(this.plugin.settings.url)
|
||||
.onChange(async (value) => {
|
||||
console.log("Blog URL: " + value);
|
||||
console.log("API URL: " + value);
|
||||
this.plugin.settings.url = value;
|
||||
await this.plugin.saveSettings();
|
||||
})
|
||||
@@ -57,13 +44,12 @@ export class SettingTab extends PluginSettingTab {
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName("Admin API Key")
|
||||
.setDesc("Your custom integration Admin API Key")
|
||||
.setDesc("Your Ghost integration's Admin API Key")
|
||||
.addText((text) =>
|
||||
text
|
||||
.setPlaceholder("6251555c94ca6")
|
||||
.setValue(this.plugin.settings.adminToken)
|
||||
.onChange(async (value) => {
|
||||
console.log("admin api key: " + value);
|
||||
this.plugin.settings.adminToken = value;
|
||||
await this.plugin.saveSettings();
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user