Skip to content

Commit

Permalink
feat: implement new mechanisms for generating and managing attachment…
Browse files Browse the repository at this point in the history
… thumbnails (#6454)

#### What type of PR is this?
/kind feature
/area core
/milestone 2.19.x

#### What this PR does / why we need it:
实现了图片类型的附件缩略图生成和管理的新机制

实现依据 RFC:halo-dev/rfcs#24

使用缩略图前需要配置 externalUrl 才能生成

**How to test it?**
1. 测试本地缩略图的文件是否正确,每个图片对应到相应 size 的目录如 thumbnails/w400 应该是一对一
2. 每个图片生成缩略图的只会在 `http://localhost:8090/apis/storage.halo.run/v1alpha1/thumbnails` 中存在一份记录
3. 测试删除附件会删除对应的缩略图文件和 [thumbnails](http://localhost:8090/apis/storage.halo.run/v1alpha1/thumbnails) 
记录
4. 修改 externalUrl 以上功能均不会受到影响

#### Which issue(s) this PR fixes:
Fixes #2387 

#### Does this PR introduce a user-facing change?
```release-note
附件图片支持生成多尺寸图片,文章支持响应式图片。
```
  • Loading branch information
guqing authored Aug 26, 2024
1 parent 8405a63 commit ef37aa7
Show file tree
Hide file tree
Showing 60 changed files with 5,850 additions and 187 deletions.
843 changes: 809 additions & 34 deletions api-docs/openapi/v3_0/aggregated.json

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions api-docs/openapi/v3_0/apis_console.api_v1alpha1.json
Original file line number Diff line number Diff line change
Expand Up @@ -3393,6 +3393,12 @@
"permalink": {
"type": "string",
"description": "Permalink of attachment.\nIf it is in local storage, the public URL will be set.\nIf it is in s3 storage, the Object URL will be set.\n"
},
"thumbnails": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
},
Expand Down
Loading

0 comments on commit ef37aa7

Please sign in to comment.