Skip to content

Commit

Permalink
feat: 支持 Flowus 息流
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Sep 22, 2023
1 parent 05a87fa commit c930c4e
Show file tree
Hide file tree
Showing 24 changed files with 958 additions and 15 deletions.
16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,41 @@ Names not listed in order
- [X] Yuque
- [X] Notion
- [X] Halo
- [ ] Evernote
- [X] Github
- [X] Hexo
- [X] Hugo
- [X] Jekyll
- [X] Vuepress
- [X] Vuepress2
- [X] Vitepress
- [ ] Antora
- [ ] Docsify
- [X] Gitlab
- [X] Gitlabhexo
- [X] Gitlabhugo
- [X] Gitlabjekyll
- [X] Gitlabvuepress
- [X] Gitlabvuepress2
- [X] Gitlabvitepress
- [ ] Gitlabantora
- [ ] Gitlabdocsify
- [X] Metaweblog
- [X] Cnblogs
- [X] CnBlogs
- [X] Typecho
- [X] WordPress
- [X] Zhihu
- [X] CSDN
- [X] Wechat
- [X] WeChat Official Account
- [X] Jianshu
- [X] Juejin
- [ ] 52pojie
- [ ] Bilibili
- [ ] Xiaohongshu
- [ ] Douban
- [ ] Xlog
- [ ] Mdnice
- [ ] Flowus

## Core Features

Expand Down
12 changes: 12 additions & 0 deletions README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,25 @@
- [X] 语雀
- [X] Notion
- [X] Halo
- [ ] 印象笔记
- [X] Github
- [X] Hexo
- [X] Hugo
- [X] Jekyll
- [X] Vuepress
- [X] Vuepress2
- [X] Vitepress
- [ ] Antora
- [ ] Docsify
- [X] Gitlab
- [X] Gitlabhexo
- [X] Gitlabhugo
- [X] Gitlabjekyll
- [X] Gitlabvuepress
- [X] Gitlabvuepress2
- [X] Gitlabvitepress
- [ ] Gitlabantora
- [ ] Gitlabdocsify
- [X] Metaweblog
- [X] 博客园
- [X] Typecho
Expand All @@ -67,6 +72,13 @@
- [X] 微信公众号
- [X] 简书
- [X] 掘金
- [ ] 吾爱破解
- [ ] 哔哩哔哩
- [ ] 小红书
- [ ] 豆瓣
- [ ] Xlog
- [ ] Mdnice
- [ ] Flowus 息流

## 核心特色

Expand Down
66 changes: 66 additions & 0 deletions src/adaptors/api/antora/antoraConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* Copyright (c) 2023, Terwer . All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Terwer designates this
* particular file as subject to the "Classpath" exception as provided
* by Terwer in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com
* or visit www.terwer.space if you need additional information or have any
* questions.
*/

import { CommonGithubConfig } from "~/src/adaptors/api/base/github/commonGithubConfig.ts"
import { CategoryTypeEnum, PageTypeEnum, PasswordType } from "zhi-blog-api"

/**
* Antora 配置
*/
class AntoraConfig extends CommonGithubConfig {
constructor(
githubUsername: string,
githubAuthToken: string,
githubRepo: string,
githubBranch: string,
middlewareUrl?: string
) {
super(githubUsername, githubAuthToken, githubRepo, githubBranch, middlewareUrl)

// 设置Antora的预览URL,使用文档ID作为文档预览的URL参数
this.previewUrl = "/docs/[docid]"
// 设置页面类型为Markdown或其他适用的类型
this.pageType = PageTypeEnum.Markdown
// 设置密码类型,使用GitHub令牌来管理密码
this.passwordType = PasswordType.PasswordType_Token
// 是否启用标签
this.tagEnabled = true
// 是否启用分类
this.cateEnabled = true
// 是否启用知识空间
this.knowledgeSpaceEnabled = true
// 知识空间的标题
this.knowledgeSpaceTitle = "文档库"
// 知识空间的类型,可以根据实际情况选择
this.knowledgeSpaceType = CategoryTypeEnum.CategoryType_Tree_Single
// 是否允许更改知识空间
this.allowKnowledgeSpaceChange = false
// 设置知识空间只读模式的提示
this.placeholder.knowledgeSpaceReadonlyModeTip =
"由于Antora平台的限制,暂时不支持编辑所属文档库。如需修改,请删除之后重新发布。"
}
}

export { AntoraConfig }
60 changes: 60 additions & 0 deletions src/adaptors/api/docsify/docsifyConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* Copyright (c) 2023, Terwer . All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Terwer designates this
* particular file as subject to the "Classpath" exception as provided
* by Terwer in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com
* or visit www.terwer.space if you need additional information or have any
* questions.
*/

import { CommonGithubConfig } from "~/src/adaptors/api/base/github/commonGithubConfig.ts"
import { CategoryTypeEnum, PageTypeEnum, PasswordType } from "zhi-blog-api"

/**
* Docsify 配置
*/
class DocsifyConfig extends CommonGithubConfig {
constructor(
githubUsername: string,
githubAuthToken: string,
githubRepo: string,
githubBranch: string,
middlewareUrl?: string
) {
super(githubUsername, githubAuthToken, githubRepo, githubBranch, middlewareUrl)

// 修改 Docsify 配置特有的属性
this.previewUrl = "/[user]/[repo]/blob/[branch]/[docpath]"
this.pageType = PageTypeEnum.Markdown
this.passwordType = PasswordType.PasswordType_Token
this.allowPreviewUrlChange = false
this.tagEnabled = true
this.cateEnabled = true
this.allowCateChange = true
this.categoryType = CategoryTypeEnum.CategoryType_Multi
this.knowledgeSpaceEnabled = true
this.allowKnowledgeSpaceChange = false
this.placeholder.knowledgeSpaceReadonlyModeTip = "Docsify 平台暂不支持修改发布目录,如需修改,请删除之后重新发布"
this.knowledgeSpaceType = CategoryTypeEnum.CategoryType_Tree_Single
this.useMdFilename = false
this.usePathCategory = false
}
}

export { DocsifyConfig }
72 changes: 72 additions & 0 deletions src/adaptors/api/gitlab-antora/gitlabantoraConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*
* Copyright (c) 2023, Terwer . All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Terwer designates this
* particular file as subject to the "Classpath" exception as provided
* by Terwer in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com
* or visit www.terwer.space if you need additional information or have any
* questions.
*/

import { CategoryTypeEnum, PageTypeEnum, PasswordType } from "zhi-blog-api"
import { HexoConfig } from "~/src/adaptors/api/hexo/hexoConfig.ts"

/**
* Gitlab Antora 配置
*/
class GitlabantoraConfig extends HexoConfig {
constructor(
githubUsername: string,
githubAuthToken: string,
githubRepo: string,
githubBranch: string,
middlewareUrl?: string
) {
super(githubUsername, githubAuthToken, githubRepo, githubBranch, middlewareUrl)

// 设置Gitlab Antora的预览URL,使用文档ID作为文档预览的URL参数
this.previewUrl = "/docs/[docid]"
// 设置页面类型为Markdown或其他适用的类型
this.pageType = PageTypeEnum.Markdown
// 设置密码类型,使用Gitlab令牌来管理密码
this.passwordType = PasswordType.PasswordType_Token
// 是否启用标签
this.tagEnabled = true
// 是否启用分类
this.cateEnabled = true
// 是否启用知识空间
this.knowledgeSpaceEnabled = true
// Gitlab Antora的主页URL
this.home = "[your-gitlab-antora-home]"
// Gitlab Antora的API URL
this.apiUrl = "[your-gitlab-antora-api-url]"
// Gitlab Antora令牌设置URL
this.tokenSettingUrl = "[your-gitlab-antora-host]/-/profile/personal_access_tokens"
// 是否显示令牌提示
this.showTokenTip = true
// 设置默认发布路径
this.defaultPath = "source/_posts"
// 设置知识空间只读模式的提示
this.placeholder.knowledgeSpaceReadonlyModeTip =
"Gitlab Antora 平台暂不支持修改发布目录,如需修改,请删除之后重新发布"
// 知识空间的类型,可以根据实际情况选择
this.knowledgeSpaceType = CategoryTypeEnum.CategoryType_Tree_Single
}
}

export { GitlabantoraConfig }
67 changes: 67 additions & 0 deletions src/adaptors/api/gitlab-docsify/GitlabdocsifyConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Copyright (c) 2023, Terwer . All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Terwer designates this
* particular file as subject to the "Classpath" exception as provided
* by Terwer in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Terwer, Shenzhen, Guangdong, China, youweics@163.com
* or visit www.terwer.space if you need additional information or have any
* questions.
*/

import { CategoryTypeEnum, PageTypeEnum, PasswordType } from "zhi-blog-api"
import { CommonGithubConfig } from "~/src/adaptors/api/base/github/commonGithubConfig.ts"

/**
* Gitlab Docsify 配置
*/
class GitlabdocsifyConfig extends CommonGithubConfig {
constructor(
githubUsername: string,
githubAuthToken: string,
githubRepo: string,
githubBranch: string,
middlewareUrl?: string
) {
super(githubUsername, githubAuthToken, githubRepo, githubBranch, middlewareUrl)

this.home = "[your-gitlab-home]"
this.apiUrl = "[your-gitlab-api-url]"
this.tokenSettingUrl = "[your-gitlab-host]/-/profile/personal_access_tokens"
this.showTokenTip = true
this.defaultPath = "source/_posts"
this.previewUrl = "/[user]/[repo]/blob/[branch]/[docpath]"
this.previewPostUrl = "/post/[postid].html"
this.mdFilenameRule = "[slug].md"
this.pageType = PageTypeEnum.Markdown
this.passwordType = PasswordType.PasswordType_Token
this.allowPreviewUrlChange = false
this.tagEnabled = true
this.cateEnabled = true
this.allowCateChange = true
this.categoryType = CategoryTypeEnum.CategoryType_Multi
this.knowledgeSpaceEnabled = true
this.allowKnowledgeSpaceChange = false
this.placeholder.knowledgeSpaceReadonlyModeTip =
"Gitlab Docsify 平台暂不支持修改发布目录,如需修改,请删除之后重新发布"
this.knowledgeSpaceType = CategoryTypeEnum.CategoryType_Tree_Single
this.useMdFilename = false
this.usePathCategory = false
}
}

export { GitlabdocsifyConfig }
Loading

0 comments on commit c930c4e

Please sign in to comment.