chore: rename tistory publisher to blog publisher
This commit is contained in:
parent
140ea85459
commit
3d806c8fc2
14
README.md
14
README.md
|
@ -1,6 +1,6 @@
|
||||||
# Tistory Publisher
|
# Blog Publisher
|
||||||
|
|
||||||
The Tistory Publisher plugin helps to publish obsidian notes to tistory. You only need to go through 3 steps to publish your note. please check the demo tab below for detailed instructions.
|
The Blog Publisher plugin helps to publish obsidian notes to blog platform. You only need to go through 3 steps to publish your note. please check the demo tab below for detailed instructions.
|
||||||
|
|
||||||
### Demo
|
### Demo
|
||||||
|
|
||||||
|
@ -8,13 +8,13 @@ The Tistory Publisher plugin helps to publish obsidian notes to tistory. You onl
|
||||||
|
|
||||||
### How to use
|
### How to use
|
||||||
|
|
||||||
1. settings default `access token`, `visibility`, ``blog name``
|
1. settings default `access token`, `visibility`, ``blog name``, `platform`
|
||||||
[settings.png](./src/images/settings.png)
|
[settings.png](./src/images/settings.png)
|
||||||
2. select the note that want to publish
|
2. select the note that want to publish
|
||||||
3. open command tab and enter `publish-to-tistory`
|
3. open command tab and enter `publish-post`
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
- use github actions automatically generate tags
|
- use github actions automatically generate tags.
|
||||||
- update the post using postId
|
- add blog platform.
|
||||||
- delete the post using postId
|
- delete the post using postId.
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
{
|
{
|
||||||
"id": "Tistory Publisher Plugin",
|
"id": "Blog Publisher Plugin",
|
||||||
"name": "Tistory Publisher Plugin",
|
"name": "Blog Publisher Plugin",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"minAppVersion": "0.15.0",
|
"minAppVersion": "0.15.0",
|
||||||
"description": "Easily publish a note in obsidian to tistory",
|
"description": "Easily publish a note in obsidian to blog",
|
||||||
"author": "bekurin",
|
"author": "bekurin",
|
||||||
"authorUrl": "https://obsidian.md",
|
"authorUrl": "https://obsidian.md",
|
||||||
"fundingUrl": "https://obsidian.md/pricing",
|
"fundingUrl": "https://obsidian.md/pricing",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "tistory-publisher",
|
"name": "blog-publisher",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "easily publisher a note in obsidian to tistory",
|
"description": "easily publisher a note in obsidian to blog",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "node esbuild.config.mjs",
|
"dev": "node esbuild.config.mjs",
|
||||||
|
|
|
@ -1,18 +1,19 @@
|
||||||
import { App, PluginSettingTab, Setting } from "obsidian";
|
import { App, PluginSettingTab, Setting } from "obsidian";
|
||||||
import TistoryPublisherPlugin from "src/main";
|
import BlogPublisherPlugin from "src/main";
|
||||||
|
|
||||||
class TistoryPublisherSettingTab extends PluginSettingTab {
|
class BlogPublisherSettingTab extends PluginSettingTab {
|
||||||
plugin: TistoryPublisherPlugin
|
plugin: BlogPublisherPlugin
|
||||||
|
|
||||||
constructor(app: App, plugin: TistoryPublisherPlugin) {
|
constructor(app: App, plugin: BlogPublisherPlugin) {
|
||||||
super(app, plugin)
|
super(app, plugin)
|
||||||
this.plugin = plugin
|
this.plugin = plugin
|
||||||
}
|
}
|
||||||
|
|
||||||
display() {
|
display() {
|
||||||
const {containerEl: settingContainerEl} = this
|
const {containerEl: settingContainerEl} = this
|
||||||
|
const defaultPlatformOptions = {"tistory": "tistory"}
|
||||||
settingContainerEl.empty()
|
settingContainerEl.empty()
|
||||||
settingContainerEl.createEl("h2", {text: "Tistory Publisher"})
|
settingContainerEl.createEl("h2", {text: "Blog Publisher"})
|
||||||
|
|
||||||
new Setting(settingContainerEl)
|
new Setting(settingContainerEl)
|
||||||
.setName("Access Token")
|
.setName("Access Token")
|
||||||
|
@ -49,7 +50,19 @@ class TistoryPublisherSettingTab extends PluginSettingTab {
|
||||||
await this.plugin.saveSettings()
|
await this.plugin.saveSettings()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
new Setting(settingContainerEl)
|
||||||
|
.setName("Blog Platform")
|
||||||
|
.setDesc("select the platform want to publish.")
|
||||||
|
.addDropdown((cb) => {
|
||||||
|
cb.addOptions(defaultPlatformOptions)
|
||||||
|
.setValue(this.plugin.settings.platform)
|
||||||
|
.onChange(async (value) => {
|
||||||
|
this.plugin.settings.platform = value
|
||||||
|
await this.plugin.saveSettings()
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default TistoryPublisherSettingTab
|
export default BlogPublisherSettingTab
|
|
@ -1,12 +1,14 @@
|
||||||
|
|
||||||
export interface TistoryPublisherSettings {
|
export interface BlogPublisherSettings {
|
||||||
accessToken: string;
|
accessToken: string;
|
||||||
blogName: string;
|
blogName: string;
|
||||||
visibility: string;
|
visibility: string;
|
||||||
|
platform: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const DEFFAULT_SETTINGS: TistoryPublisherSettings = {
|
export const DEFFAULT_SETTINGS: BlogPublisherSettings = {
|
||||||
accessToken: "",
|
accessToken: "",
|
||||||
blogName: "",
|
blogName: "",
|
||||||
visibility: "0"
|
visibility: "0",
|
||||||
|
platform: "tistory"
|
||||||
}
|
}
|
10
src/main.ts
10
src/main.ts
|
@ -1,17 +1,17 @@
|
||||||
import { Plugin, Editor, MarkdownView, MarkdownRenderer } from "obsidian";
|
import { Plugin, Editor, MarkdownView, MarkdownRenderer } from "obsidian";
|
||||||
import { DEFFAULT_SETTINGS, TistoryPublisherSettings } from "./components/settings";
|
import { DEFFAULT_SETTINGS, BlogPublisherSettings as BlogPublisherSettings } from "./components/settings";
|
||||||
import {PublishModal, ModifyModal} from "./components/modal";
|
import {PublishModal, ModifyModal} from "./components/modal";
|
||||||
import createPostApi from "./api/createPostApi";
|
import createPostApi from "./api/createPostApi";
|
||||||
import TistoryPublisherSettingTab from "./components/settingTab";
|
import BlogPublisherSettingTab from "./components/settingTab";
|
||||||
import modifyPostApi from "./api/updatePostApi";
|
import modifyPostApi from "./api/updatePostApi";
|
||||||
|
|
||||||
export default class TistoryPublisherPlugin extends Plugin {
|
export default class BlogPublisherPlugin extends Plugin {
|
||||||
settings: TistoryPublisherSettings
|
settings: BlogPublisherSettings
|
||||||
|
|
||||||
async onload() {
|
async onload() {
|
||||||
// load default settings
|
// load default settings
|
||||||
await this.loadSettings()
|
await this.loadSettings()
|
||||||
this.addSettingTab(new TistoryPublisherSettingTab(this.app, this))
|
this.addSettingTab(new BlogPublisherSettingTab(this.app, this))
|
||||||
|
|
||||||
// create publish-to command
|
// create publish-to command
|
||||||
this.addCommand({
|
this.addCommand({
|
||||||
|
|
Loading…
Reference in New Issue