Skip to content

Commit

Permalink
Merge pull request #595 from terwer/dev
Browse files Browse the repository at this point in the history
feat: #593 插件版支持图床替换图片
  • Loading branch information
terwer committed Aug 11, 2023
2 parents 5a35a67 + bc645c0 commit 7b40600
Show file tree
Hide file tree
Showing 12 changed files with 416 additions and 60 deletions.
2 changes: 1 addition & 1 deletion README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
## 核心特色

- [X] **极速发布**:一次配置,一键发布
- [ ] **图床管理**:集成 PicGO 图床,支持 s3、minio、水印插件
- [ ] **图床管理**:集成 PicGO 图床,支持 s3、minio、水印插件 [仅支持PC客户端]
- [X] **支持扩展**:基于统一的博客 API 规范,内置 metaweblogAPI 、 WordPress 、Wechatsync 和 Github 支持,并提供了统一的适配器,理论上可支持扩展到任何平台
- [X] **平台开关**:所有平台均支持启用禁用,默认开启博客园,可随时禁用
- [X] **动态新增**:支持自定义添加平台
Expand Down
1 change: 1 addition & 0 deletions esbuild.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const isServe = args.serve || args.s || false
let baseDir
if (isWatch || isServe) {
baseDir = "/Users/terwer/Documents/mydocs/SiYuanWorkspace/test/data/plugins/siyuan-plugin-publisher"
// baseDir = "/Users/terwer/Documents/mydocs/SiYuanWorkspace/public/data/plugins/siyuan-plugin-publisher"
} else {
baseDir = "./"
}
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,20 @@
"shorthash2": "^1.0.3",
"simple-xmlrpc": "^1.4.2",
"siyuan": "^0.7.9",
"siyuan-plugin-picgo": "^1.2.0",
"uuid": "^9.0.0",
"vue": "^3.3.4",
"vue-i18n": "^9.2.2",
"vue-router": "^4.2.4",
"xmlbuilder2": "^3.1.1",
"zhi-blog-api": "^1.20.17",
"zhi-common": "^1.14.1",
"zhi-common": "^1.14.2",
"zhi-device": "^2.3.0",
"zhi-fetch-middleware": "^0.2.19",
"zhi-github-middleware": "^0.2.1",
"zhi-fetch-middleware": "^0.2.20",
"zhi-github-middleware": "^0.2.2",
"zhi-lib-base": "^0.4.4",
"zhi-notion-markdown": "^0.1.2",
"zhi-siyuan-api": "^2.0.19",
"zhi-xmlrpc-middleware": "^0.4.14"
"zhi-siyuan-api": "^2.0.21",
"zhi-xmlrpc-middleware": "^0.4.15"
}
}
155 changes: 118 additions & 37 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion siyuan/invoke/pluginInvoke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export class PluginInvoke {

public async showBlogDialog() {
const pageId: string | undefined = PageUtil.getPageId()
const pageUrl = `${this.blogPluginBase}/post/${pageId}`

// 临时开启预览权限
let isShared = false
Expand All @@ -59,14 +60,15 @@ export class PluginInvoke {
this.logger.info("The document is not shared, will temporarily turn on preview permissions")
}

const pageUrl = `${this.blogPluginBase}/post/${pageId}`
showIframeDialog(this.pluginInstance, pageUrl, undefined, undefined, undefined, async (options?: IObject) => {
// 回收预览权限
if (!isShared) {
await this.pluginInstance.kernelApi.setBlockAttrs(pageId, {
"custom-publish-status": "draft",
})
this.logger.info("Temporary permissions are turned off")
} else {
this.logger.info("Already shared, do nothing")
}
})
}
Expand Down
Loading

0 comments on commit 7b40600

Please sign in to comment.