Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
此分支是支持R2作为图片存储后端的实验性分支(Beta)用于实验R2作为图片储存位置的可能性
以下是如何配置和使用 R2 存储的说明文档:
Telegraph-Image R2 存储配置指南
本地开发配置
npx wrangler pages dev ./ \ --kv "img_url" \ --port 8080 \ --binding BASIC_USER=admin \ --binding BASIC_PASS=123 \ --persist-to ./data \ --r2 BUCKET \ --binding UPLOAD_MODE=R2
线上环境配置
在 Cloudflare Dashboard 创建 R2 bucket:
在 Pages 项目设置中绑定 R2:
BUCKET
设置环境变量:
UPLOAD_MODE=R2
注意事项
./data
目录下/file/[filename]