mirror of
https://github.com/barkstone2/vault-to-blog.git
synced 2026-07-22 05:21:19 +00:00
docs: 플러그인 이름 변경
- OTB 키워드를 VTB로 변경
This commit is contained in:
parent
93b00669a5
commit
99ef282aaf
12 changed files with 38 additions and 38 deletions
|
|
@ -1,4 +1,4 @@
|
|||
# Obsidian To Blog
|
||||
# Vault To Blog
|
||||
A Community Plugin for [Obsidian.md](https://obsidian.md/) to publish your vault or directory to GitHub Pages Blog.
|
||||
> This plugin is currently in beta, so it only offers a limited set of features at the moment.
|
||||
|
||||
|
|
@ -49,7 +49,7 @@ A Community Plugin for [Obsidian.md](https://obsidian.md/) to publish your vault
|
|||
- Math blocks are supported
|
||||
- Inline math expressions are supported
|
||||
## Bug Report
|
||||
To report a bug, simply go to the [Issues](https://github.com/barkstone2/obsidian-to-blog/issues) tab and use the provided template to submit your bug report.
|
||||
To report a bug, simply go to the [Issues](https://github.com/barkstone2/vault-to-blog/issues) tab and use the provided template to submit your bug report.
|
||||
|
||||
## Support
|
||||
If you like this plugin and would like to support its development, you can support me on Buy me a coffee.
|
||||
|
|
|
|||
14
main.ts
14
main.ts
|
|
@ -1,27 +1,27 @@
|
|||
import {Notice, Plugin} from 'obsidian';
|
||||
import {Paths} from "./src/store/paths";
|
||||
import {StatusBar} from "./src/layout/statusBar";
|
||||
import {OTBSettingTab} from './src/layout/settingTab';
|
||||
import {VTBSettingTab} from './src/layout/settingTab';
|
||||
import {FileUtils} from "./src/utils/fileUtils";
|
||||
import {GitUtils} from "./src/utils/gitUtils";
|
||||
import {Urls} from "./src/store/urls";
|
||||
|
||||
export interface ObsidianToBlogSettings {
|
||||
export interface VaultToBlogSettings {
|
||||
sourceDir: string;
|
||||
repositoryUrl: string;
|
||||
isActivated: boolean;
|
||||
version: string;
|
||||
}
|
||||
|
||||
const DEFAULT_SETTINGS: ObsidianToBlogSettings = {
|
||||
const DEFAULT_SETTINGS: VaultToBlogSettings = {
|
||||
sourceDir: '',
|
||||
repositoryUrl: '',
|
||||
isActivated: false,
|
||||
version: '0.0.1'
|
||||
};
|
||||
|
||||
export default class ObsidianToBlog extends Plugin {
|
||||
settings: ObsidianToBlogSettings;
|
||||
export default class VaultToBlog extends Plugin {
|
||||
settings: VaultToBlogSettings;
|
||||
statusBar: StatusBar;
|
||||
paths: Paths;
|
||||
urls: Urls;
|
||||
|
|
@ -35,7 +35,7 @@ export default class ObsidianToBlog extends Plugin {
|
|||
await this.loadUtils();
|
||||
this.statusBar = new StatusBar(this.addStatusBarItem(), this);
|
||||
await this.renderStatusBar()
|
||||
this.addSettingTab(new OTBSettingTab(this.app, this, this.settings, this.paths, this.gitUtils, this.fileUtils));
|
||||
this.addSettingTab(new VTBSettingTab(this.app, this, this.settings, this.paths, this.gitUtils, this.fileUtils));
|
||||
await this.checkVersion();
|
||||
}
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ export default class ObsidianToBlog extends Plugin {
|
|||
async checkVersion() {
|
||||
if (this.settings.version !== this.manifest.version) {
|
||||
if (this.settings.isActivated) {
|
||||
new Notice('OTB plugin is inactivated due to detection of changing version. Please reactivate.', 5000)
|
||||
new Notice('VTB plugin is inactivated due to detection of changing version. Please reactivate.', 5000)
|
||||
await this.doInactivate();
|
||||
await this.saveSettings();
|
||||
} else {
|
||||
|
|
|
|||
4
package-lock.json
generated
4
package-lock.json
generated
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"name": "obsidian-to-blog",
|
||||
"name": "vault-to-blog",
|
||||
"version": "0.0.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "obsidian-to-blog",
|
||||
"name": "vault-to-blog",
|
||||
"version": "0.0.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "obsidian-to-blog",
|
||||
"name": "vault-to-blog",
|
||||
"version": "0.0.1",
|
||||
"description": "An Obsidian plugin to publish an Obsidian vault or directory to a GitHub Pages blog.",
|
||||
"main": "main.js",
|
||||
|
|
|
|||
4
react-app/package-lock.json
generated
4
react-app/package-lock.json
generated
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"name": "obsidian-to-blog-react-app",
|
||||
"name": "vault-to-blog-react-app",
|
||||
"version": "0.0.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "obsidian-to-blog",
|
||||
"name": "vault-to-blog-react-app",
|
||||
"version": "0.0.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "obsidian-to-blog-react-app",
|
||||
"name": "vault-to-blog-react-app",
|
||||
"private": true,
|
||||
"version": "0.0.1",
|
||||
"type": "module",
|
||||
|
|
|
|||
|
|
@ -1,18 +1,18 @@
|
|||
import {App, normalizePath, Notice, PluginSettingTab, SearchComponent, Setting, TFolder} from "obsidian";
|
||||
import Awesomplete from "awesomplete";
|
||||
import OTBPlugin, {ObsidianToBlogSettings} from "../../main";
|
||||
import VTBPlugin, {VaultToBlogSettings} from "../../main";
|
||||
import {Paths} from "../store/paths";
|
||||
import {GitUtils} from "../utils/gitUtils";
|
||||
import {FileUtils} from "../utils/fileUtils";
|
||||
|
||||
export class OTBSettingTab extends PluginSettingTab {
|
||||
plugin: OTBPlugin;
|
||||
export class VTBSettingTab extends PluginSettingTab {
|
||||
plugin: VTBPlugin;
|
||||
paths: Paths;
|
||||
settings: ObsidianToBlogSettings;
|
||||
settings: VaultToBlogSettings;
|
||||
gitUtils: GitUtils;
|
||||
fileUtils: FileUtils;
|
||||
|
||||
constructor(app: App, plugin: OTBPlugin, settings: ObsidianToBlogSettings, paths: Paths, gitUtils: GitUtils, fileUtils: FileUtils) {
|
||||
constructor(app: App, plugin: VTBPlugin, settings: VaultToBlogSettings, paths: Paths, gitUtils: GitUtils, fileUtils: FileUtils) {
|
||||
super(app, plugin);
|
||||
this.plugin = plugin;
|
||||
this.settings = settings;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import ObsidianToBlog from "../../main";
|
||||
import VaultToBlog from "../../main";
|
||||
import {Notice} from "obsidian";
|
||||
|
||||
export class StatusBar {
|
||||
private iconSrc = 'https://raw.githubusercontent.com/barkstone2/obsidian-to-blog/main/react-app/public/favicon.ico'
|
||||
constructor(private statusBarEl: HTMLElement, private readonly plugin: ObsidianToBlog) {
|
||||
private iconSrc = 'https://raw.githubusercontent.com/barkstone2/vault-to-blog/main/react-app/public/favicon.ico'
|
||||
constructor(private statusBarEl: HTMLElement, private readonly plugin: VaultToBlog) {
|
||||
statusBarEl.createEl('img', {cls: 'status-bar-icon', attr: {src: this.iconSrc}})
|
||||
statusBarEl.addClass('mod-clickable')
|
||||
statusBarEl.ariaLabel = 'Publish to GitHub Page.';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import {App, FileSystemAdapter} from "obsidian";
|
||||
import {ObsidianToBlogSettings} from "../../main";
|
||||
import {VaultToBlogSettings} from "../../main";
|
||||
|
||||
export class Paths {
|
||||
app: App;
|
||||
|
|
@ -16,11 +16,11 @@ export class Paths {
|
|||
sourcePublicPath;
|
||||
typeJsonDestPath;
|
||||
|
||||
constructor(app: App, settings: ObsidianToBlogSettings) {
|
||||
constructor(app: App, settings: VaultToBlogSettings) {
|
||||
this.app = app;
|
||||
this.configDir = () => app.vault.configDir
|
||||
this.vaultPath = () => this.getVaultPath();
|
||||
this.pluginPath = () => `${this.vaultPath()}/${this.configDir()}/plugins/obsidian-to-blog`;
|
||||
this.pluginPath = () => `${this.vaultPath()}/${this.configDir()}/plugins/vault-to-blog`;
|
||||
this.gitBackupPath = () => `${this.pluginPath()}/.git-backup`
|
||||
this.typeJsonSourcePath = () => `${this.vaultPath()}/${this.configDir()}/types.json`;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import {ObsidianToBlogSettings} from "../../main";
|
||||
import {VaultToBlogSettings} from "../../main";
|
||||
|
||||
export class Urls {
|
||||
otbRepositoryURL = 'https://github.com/barkstone2/obsidian-to-blog'
|
||||
vtbRepositoryURL = 'https://github.com/barkstone2/vault-to-blog'
|
||||
reactAppUrl;
|
||||
constructor(settings: ObsidianToBlogSettings) {
|
||||
this.reactAppUrl = () => `${this.otbRepositoryURL}/releases/download/${settings.version}/react-app.zip`;
|
||||
constructor(settings: VaultToBlogSettings) {
|
||||
this.reactAppUrl = () => `${this.vtbRepositoryURL}/releases/download/${settings.version}/react-app.zip`;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
import {Notice} from "obsidian";
|
||||
import {Paths} from "../store/paths";
|
||||
import {ObsidianToBlogSettings} from "../../main";
|
||||
import {VaultToBlogSettings} from "../../main";
|
||||
import fs from "fs";
|
||||
import {Urls} from "../store/urls";
|
||||
import AdmZip from 'adm-zip';
|
||||
|
|
@ -10,8 +10,8 @@ import {httpGetAsync} from "./httpUtils";
|
|||
export class FileUtils {
|
||||
paths: Paths;
|
||||
urls: Urls;
|
||||
settings: ObsidianToBlogSettings;
|
||||
constructor(paths: Paths, urls: Urls, settings: ObsidianToBlogSettings) {
|
||||
settings: VaultToBlogSettings;
|
||||
constructor(paths: Paths, urls: Urls, settings: VaultToBlogSettings) {
|
||||
this.paths = paths;
|
||||
this.urls = urls;
|
||||
this.settings = settings;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
import {Notice} from "obsidian";
|
||||
import OTBPlugin, {ObsidianToBlogSettings} from "../../main";
|
||||
import VTBPlugin, {VaultToBlogSettings} from "../../main";
|
||||
import {findFiles} from "./fsUtils";
|
||||
import simpleGit from 'simple-git';
|
||||
|
||||
const git = simpleGit();
|
||||
export class GitUtils {
|
||||
plugin: OTBPlugin;
|
||||
settings: ObsidianToBlogSettings;
|
||||
constructor(plugin: OTBPlugin, settings: ObsidianToBlogSettings) {
|
||||
plugin: VTBPlugin;
|
||||
settings: VaultToBlogSettings;
|
||||
constructor(plugin: VTBPlugin, settings: VaultToBlogSettings) {
|
||||
this.plugin = plugin;
|
||||
this.settings = settings;
|
||||
}
|
||||
|
|
@ -60,7 +60,7 @@ export class GitUtils {
|
|||
}
|
||||
}
|
||||
|
||||
async commitChanges(options: {cwd: string}, noticeDuration: number, message = "Blog published by OTB") {
|
||||
async commitChanges(options: {cwd: string}, noticeDuration: number, message = "Blog published by VTB") {
|
||||
try {
|
||||
await git.cwd(options.cwd);
|
||||
await git.commit(message);
|
||||
|
|
|
|||
Loading…
Reference in a new issue