Skip to content

Commit

Permalink
feat: 支持发布到知乎
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Aug 9, 2023
1 parent 0a8d119 commit 4723632
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 126 deletions.
34 changes: 8 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,20 @@ Publish articles from Siyuan Notes to platforms such as Yuque, Notion, Cnblogs,

Support features such as fast publishing, image bed management, platform expansion, smart labels, etc.

> **Note: This plugin is in the rapid iteration and pre-beta testing stage, the function is not yet stable, if you encounter the problem that you cannot use it, you can try the following steps to fix it:**
> **Front Announcement: Publish Tool's First Stable Version '1.6.0' Released!**
(1) Uninstall the plugin
We recommend that you use the `uninstall->install` method to update. If the configuration is abnormal, please back up `[workspace]/data/storage/syp/sy-p-plus-cfg.json` , and then delete it, this configuration file will be automatically initialized the first time it is used.

![](./help/help_1.png)

(2) Download and install again

(3) Re-enable

![](./help/help_2.png)

(4) If a platform configuration is incomplete, you can disable the platform configuration, then delete the platform and add it again.

If you still can't use this step after this step, [New issue](https://github.com/terwer/siyuan-plugin-publisher/issues/new) is welcome.

**This tip will be removed after the stable release.**
In later releases, the release configuration will only be backward compatible to `1.6.0+`.

## Recent critical updates and bug fixes

- Optimized HEXO article link conversion rules
- Fixed configuration fetch error
- Fixed the issue where the widget gets the document ID incorrectly
- Support article binding
- HEXO supports YAML
- Support publishing to Zhihu
- Support for publishing to Hexo
- Support for publishing to Notion
- Support for Yuque,Cnblogs, Metaweblog, Typecho, WordPress
- Support automatic generation of article aliases
- Unified integration of platform configurations
- Complete HEXO adaptation
- Added notion support
- Support for changing the default knowledge base
- Added support for general releases with fine-grained configuration
- Support for Yuque, Cnblogs, Metaweblog, Typecho, WordPress

## Compatibility of Origin notes

Expand Down Expand Up @@ -74,7 +56,7 @@ Names not listed in order
- [X] Github
- [X] Hexo
- [X] Notion
- [ ] Zhihu
- [X] Zhihu

## Core Features

Expand Down
34 changes: 8 additions & 26 deletions README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,20 @@

将思源笔记的文章发布到语雀、Notion、Cnblogs、WordPress、Typecho、Hexo、知乎 等平台,支持极速发布、图床管理、平台扩展、智能标签等特色功能。

> **注意:本插件当前处于快速迭代和前期beta测试阶段,功能尚不稳定,仅作为前期尝鲜测试,不建议正式使用。如果您遇到了无法使用的问题,可尝试以下步骤修复:**
> **前排公告:发布工具首个稳定版 `1.6.0` 发布!**
(1)卸载插件
我们建议您采用 `卸载->重装` 的方式进行更新。如果配置异常请先备份 `[工作空间]/data/storage/syp/sy-p-plus-cfg.json` ,然后删除他,这个配置文件会在第一次使用的时候自动初始化。

![](./help/help_1.png)

(2)重新下载安装

(3)重新启用

![](./help/help_2.png)

(4)如果某个平台配置不完整,可以禁用平台配置、然后删除这个平台并重新添加。

若此步骤之后还是无法使用,或者您有任何建议和需求,欢迎 [新建issue](https://github.com/terwer/siyuan-plugin-publisher/issues/new)

**本提示会在稳定版发布后移除。**
之后的版本中,发布配置将仅向后兼容到 `1.6.0+`

## 最近的关键更新与 Bug 修复

- 优化 hexo 文章链接转换规则
- 修复配置获取错误问题
- 修复挂件获取文档id错误的问题
- 支持文章绑定
- hexo 支持 yaml
- 支持发布到知乎
- 支持发布到 Hexo
- 支持发布到 Notion
- 支持语雀、博客园、metaweblog、typecho、wordpress
- 支持自动生成文章别名
- 统一整合各平台配置
- 完成 hexo 适配
- 新增 notion 支持
- 语雀支持更改默认知识库
- 新增支持细粒度配置的常规发布
- 支持 语雀、博客园、metaweblog、typecho、wordpress

## 思源笔记兼容情况

Expand Down Expand Up @@ -72,7 +54,7 @@
- [X] Github
- [X] Hexo
- [X] Notion
- [ ] 知乎
- [X] 知乎

## 核心特色

Expand Down
40 changes: 20 additions & 20 deletions src/adaptors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,26 +101,26 @@ class Adaptors {
blogAdaptor = webApi
break
}
case SubPlatformType.Custom_CSDN: {
const { webApi } = await useCsdnWeb(key, newCfg)
blogAdaptor = webApi
break
}
case SubPlatformType.Custom_Jianshu: {
const { webApi } = await useJianshuWeb(key, newCfg)
blogAdaptor = webApi
break
}
case SubPlatformType.Custom_Juejin: {
const { webApi } = await useJuejinWeb(key, newCfg)
blogAdaptor = webApi
break
}
case SubPlatformType.Custom_Wechat: {
const { webApi } = await useWechatWeb(key, newCfg)
blogAdaptor = webApi
break
}
// case SubPlatformType.Custom_CSDN: {
// const { webApi } = await useCsdnWeb(key, newCfg)
// blogAdaptor = webApi
// break
// }
// case SubPlatformType.Custom_Jianshu: {
// const { webApi } = await useJianshuWeb(key, newCfg)
// blogAdaptor = webApi
// break
// }
// case SubPlatformType.Custom_Juejin: {
// const { webApi } = await useJuejinWeb(key, newCfg)
// blogAdaptor = webApi
// break
// }
// case SubPlatformType.Custom_Wechat: {
// const { webApi } = await useWechatWeb(key, newCfg)
// blogAdaptor = webApi
// break
// }
case SubPlatformType.System_Siyuan: {
const { blogApi } = useSiyuanApi()
blogAdaptor = blogApi
Expand Down
2 changes: 1 addition & 1 deletion src/locales/zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ export default {
"目前支持Metaweblog的平台有:博客园、Typecho等,采用 API 授权。MetaWeblog API 作为XML-RPC Web 服务实现,是目前公认的开放博客标准。",
"setting.platform.custom": "自定义 HTTP 协议",
"setting.platform.custom.desc":
"目前支持自定义HTTP协议的平台有:知乎、简书、掘金等,采用网页授权。自定义HTTP协议通过类似 WeChatSync 的方式实现。",
"目前支持自定义HTTP协议的平台有:知乎等,采用网页授权。自定义HTTP协议通过类似 WeChatSync 的方式实现。",
"setting.platform.right.tips0": "特别提示:",
"setting.platform.right.tips1": "1、在这里可以进行发布配置,直接点击 [设置图标] 即可进行配置。",
"setting.platform.right.tips2": "2、如需新增平台,直接点击左侧 + 按钮即可。",
Expand Down
16 changes: 8 additions & 8 deletions src/platforms/dynamicConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ export enum SubPlatformType {

// Custom
Custom_Zhihu = "Zhihu",
Custom_CSDN = "Csdn",
Custom_Jianshu = "Jianshu",
Custom_Juejin = "Juejin",
Custom_Wechat = "Wechat",
// Custom_CSDN = "Csdn",
// Custom_Jianshu = "Jianshu",
// Custom_Juejin = "Juejin",
// Custom_Wechat = "Wechat",

// System
System_Siyuan = "Siyuan",
Expand Down Expand Up @@ -241,10 +241,10 @@ export function getSubtypeList(ptype: PlatformType): SubPlatformType[] {
break
case PlatformType.Custom:
subtypeList.push(SubPlatformType.Custom_Zhihu)
subtypeList.push(SubPlatformType.Custom_CSDN)
subtypeList.push(SubPlatformType.Custom_Jianshu)
subtypeList.push(SubPlatformType.Custom_Juejin)
subtypeList.push(SubPlatformType.Custom_Wechat)
// subtypeList.push(SubPlatformType.Custom_CSDN)
// subtypeList.push(SubPlatformType.Custom_Jianshu)
// subtypeList.push(SubPlatformType.Custom_Juejin)
// subtypeList.push(SubPlatformType.Custom_Wechat)
break
case PlatformType.System:
subtypeList.push(SubPlatformType.System_Siyuan)
Expand Down
90 changes: 45 additions & 45 deletions src/utils/import/pre.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,51 +108,51 @@ export const pre = {
domain: "zhihu.com",
isEnabled: false,
},
// CSDN 目前有CA验证
{
platformType: PlatformType.Custom,
subPlatformType: SubPlatformType.Custom_CSDN,
platformKey: "custom_Csdn",
platformName: "CSDN",
platformIcon: svgIcons.iconIFCSDN,
authMode: AuthMode.WEBSITE,
authUrl: "https://passport.csdn.net/login",
domain: "csdn.net",
isEnabled: false,
},
{
platformType: PlatformType.Custom,
subPlatformType: SubPlatformType.Custom_Jianshu,
platformKey: "custom_Jianshu",
platformName: "简书",
platformIcon: svgIcons.iconIFJianshu,
authMode: AuthMode.WEBSITE,
authUrl: "https://www.jianshu.com/sign_in",
domain: "jianshu.com",
isEnabled: false,
},
{
platformType: PlatformType.Custom,
subPlatformType: SubPlatformType.Custom_Juejin,
platformKey: "custom_Juejin",
platformName: "掘金",
platformIcon: svgIcons.iconIFJuejin,
authMode: AuthMode.WEBSITE,
authUrl: "https://juejin.cn/login",
domain: "juejin.cn",
isEnabled: false,
},
{
platformType: PlatformType.Custom,
subPlatformType: SubPlatformType.Custom_Wechat,
platformKey: "custom_Wechat",
platformName: "微信公众号",
platformIcon: svgIcons.iconIFWechat,
authMode: AuthMode.WEBSITE,
authUrl: "https://mp.weixin.qq.com/",
domain: "qq.com",
isEnabled: false,
},
// // CSDN 目前有CA验证
// {
// platformType: PlatformType.Custom,
// subPlatformType: SubPlatformType.Custom_CSDN,
// platformKey: "custom_Csdn",
// platformName: "CSDN",
// platformIcon: svgIcons.iconIFCSDN,
// authMode: AuthMode.WEBSITE,
// authUrl: "https://passport.csdn.net/login",
// domain: "csdn.net",
// isEnabled: false,
// },
// {
// platformType: PlatformType.Custom,
// subPlatformType: SubPlatformType.Custom_Jianshu,
// platformKey: "custom_Jianshu",
// platformName: "简书",
// platformIcon: svgIcons.iconIFJianshu,
// authMode: AuthMode.WEBSITE,
// authUrl: "https://www.jianshu.com/sign_in",
// domain: "jianshu.com",
// isEnabled: false,
// },
// {
// platformType: PlatformType.Custom,
// subPlatformType: SubPlatformType.Custom_Juejin,
// platformKey: "custom_Juejin",
// platformName: "掘金",
// platformIcon: svgIcons.iconIFJuejin,
// authMode: AuthMode.WEBSITE,
// authUrl: "https://juejin.cn/login",
// domain: "juejin.cn",
// isEnabled: false,
// },
// {
// platformType: PlatformType.Custom,
// subPlatformType: SubPlatformType.Custom_Wechat,
// platformKey: "custom_Wechat",
// platformName: "微信公众号",
// platformIcon: svgIcons.iconIFWechat,
// authMode: AuthMode.WEBSITE,
// authUrl: "https://mp.weixin.qq.com/",
// domain: "qq.com",
// isEnabled: false,
// },
],
systemCfg: <DynamicConfig[]>[
{
Expand Down

0 comments on commit 4723632

Please sign in to comment.