Skip to content

Commit

Permalink
feat: add picbed service type support
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Mar 30, 2024
1 parent 950276a commit 0be0958
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 6 deletions.
6 changes: 6 additions & 0 deletions libs/zhi-blog-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# zhi-blog-api

## 1.58.0

### Minor Changes

- feat: add picbed service type support

## 1.57.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion libs/zhi-blog-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zhi-blog-api",
"version": "1.57.0",
"version": "1.58.0",
"type": "module",
"description": "a common blog interface",
"main": "./dist/index.js",
Expand Down
3 changes: 2 additions & 1 deletion libs/zhi-blog-api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ import PostUtil from "./lib/PostUtil"
import TagInfo from "./lib/models/tagInfo"
import PageEditMode from "./lib/models/pageEditMode"
import YamlStrategy from "./lib/models/yamlStrategy"
import PicbedServiceTypeEnum from "./lib/enums/picbedServiceTypeEnum"

export { BlogApi, BlogAdaptor }
export { WebApi, WebAdaptor }
export { BlogConfig, BlogPlaceholder, PasswordType, PageType, PostStatusEnum }
export { WebConfig, WebPlaceholder }
export { Post, UserBlog, SiteConfig, CategoryInfo, TagInfo, MediaObject, Attachment }
export { BlogConstants, BlogTypeEnum, PageTypeEnum, CategoryTypeEnum }
export { BlogConstants, BlogTypeEnum, PageTypeEnum, CategoryTypeEnum, PicbedServiceTypeEnum }
export { YamlFormatObj, YamlConvertAdaptor }
export { PostUtil }
export { PreferenceConfig }
Expand Down
7 changes: 4 additions & 3 deletions libs/zhi-blog-api/src/lib/blogConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import BlogPlaceholder from "./blogPlaceholder"
import PageTypeEnum from "./enums/pageTypeEnum"
import CategoryTypeEnum from "./enums/categoryTypeEnum"
import PreferenceConfig from "./PreferenceConfig"
import PicbedServiceTypeEnum from "./enums/picbedServiceTypeEnum"

/**
* 页面类型
Expand Down Expand Up @@ -270,9 +271,9 @@ abstract class BlogConfig {
public bundledPicbedSupported?: boolean

/**
* 是否启用图片上传
* 图床服务类型
*/
public bundledPicbedEnabled?: boolean
public picbedService?: PicbedServiceTypeEnum

protected constructor() {
this.home = ""
Expand Down Expand Up @@ -310,7 +311,7 @@ abstract class BlogConfig {
this.usePathCategory = false
this.cateSearchEnabled = false
this.bundledPicbedSupported = false
this.bundledPicbedEnabled = false
this.picbedService = PicbedServiceTypeEnum.None
}
}

Expand Down
44 changes: 44 additions & 0 deletions libs/zhi-blog-api/src/lib/enums/picbedServiceTypeEnum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright (c) 2024, 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.
*/

/**
* 图片床服务类型枚举
*/
enum PicbedServiceTypeEnum {
/**
* PicGo 插件
*/
PicGo = "picgo",
/**
* 内置
*/
Bundled = "bundled",
/**
* 无
*/
None = "none",
}

export default PicbedServiceTypeEnum
7 changes: 7 additions & 0 deletions libs/zhi-siyuan-api/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# zhi-siyuan-api

## 2.20.2

### Patch Changes

- Updated dependencies
- zhi-blog-api@1.58.0

## 2.20.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion libs/zhi-siyuan-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zhi-siyuan-api",
"version": "2.20.1",
"version": "2.20.2",
"type": "module",
"description": "a siyuan-note api including both kernel and client",
"main": "./dist/index.js",
Expand Down

0 comments on commit 0be0958

Please sign in to comment.