Skip to content

Commit

Permalink
fix: 支持 Halo - 基本发布功能
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Sep 20, 2023
1 parent 5a3c99a commit 8964d66
Show file tree
Hide file tree
Showing 17 changed files with 762 additions and 27 deletions.
3 changes: 2 additions & 1 deletion custom.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@
* questions.
*/

declare module "zhi-notion-markdown"
declare module "zhi-notion-markdown"
declare module "uuid"
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"syncWidgetRepo": "python scripts/sync_widget_repo.py"
},
"devDependencies": {
"@halo-dev/api-client": "^2.9.0",
"@terwer/eslint-config-custom": "^1.3.6",
"@types/crypto-js": "^4.1.2",
"@types/node": "^18.17.17",
Expand Down Expand Up @@ -60,7 +61,9 @@
"cross-fetch": "^3.1.8",
"crypto-js": "^4.1.1",
"element-plus": "^2.3.14",
"gray-matter": "^4.0.3",
"js-base64": "^3.7.5",
"js-yaml": "^4.1.0",
"lodash": "^4.17.21",
"pinia": "^2.1.6",
"shorthash2": "^1.0.3",
Expand Down
61 changes: 57 additions & 4 deletions pnpm-lock.yaml

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

4 changes: 2 additions & 2 deletions src/adaptors/api/base/github/commonGithubApiAdaptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { DateUtil, HtmlUtil, StrUtil, YamlUtil } from "zhi-common"
import { toRaw } from "vue"
import { Base64 } from "js-base64"
import { CommonGitlabConfig } from "~/src/adaptors/api/base/gitlab/commonGitlabConfig.ts"
import IdUtil from "~/src/utils/idUtil.ts"
import sypIdUtil from "~/src/utils/sypIdUtil.ts";

/**
* Github API 适配器
Expand Down Expand Up @@ -88,7 +88,7 @@ class CommonGithubApiAdaptor extends BaseBlogApi {

// 路径处理
const savePath = post.cate_slugs?.[0] ?? cfg.blogid
const filename = post.mdFilename ?? "auto-" + IdUtil.newID()
const filename = post.mdFilename ?? "auto-" + sypIdUtil.newID()
const docPath = `${savePath}/${filename}.md`
this.logger.info("将要最终发送到以下目录 =>", docPath)

Expand Down
4 changes: 2 additions & 2 deletions src/adaptors/api/base/gitlab/commonGitlabApiAdaptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { StrUtil, YamlUtil } from "zhi-common"
import { toRaw } from "vue"
import { Base64 } from "js-base64"
import { isDev } from "~/src/utils/constants.ts"
import IdUtil from "~/src/utils/idUtil.ts"
import sypIdUtil from "~/src/utils/sypIdUtil.ts";

/**
* Gitlab API 适配器
Expand Down Expand Up @@ -90,7 +90,7 @@ class CommonGitlabApiAdaptor extends BaseBlogApi {

// 路径处理
const savePath = post.cate_slugs?.[0] ?? cfg.blogid
const filename = post.mdFilename ?? "auto-" + IdUtil.newID()
const filename = post.mdFilename ?? "auto-" + sypIdUtil.newID()
const docPath = `${savePath}/${filename}.md`
this.logger.info("将要最终发送到以下目录 =>", docPath)

Expand Down
Loading

0 comments on commit 8964d66

Please sign in to comment.