-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
958 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, [email protected] | ||
* 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 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, [email protected] | ||
* 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 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, [email protected] | ||
* 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 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, [email protected] | ||
* 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 } |
Oops, something went wrong.