Repository navigation
Expand file tree
/
Copy pathplugin.json
More file actions
58 lines (58 loc) · 1.7 KB
/
Copy pathplugin.json
File metadata and controls
58 lines (58 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{
"$schema": "../plugin.manifest.schema.json",
"id": "image-optimizer",
"name": "图片资源优化",
"version": "1.0.0",
"description": "分析历史图片素材并批量压缩为 WebP 多尺寸变体,可选回写文章与页面中的图片 URL。",
"author": "ReactPress",
"requires": ">=3.5.0",
"server": {
"module": "./dist/index.js"
},
"admin": {
"menu": {
"title": "图片优化",
"path": "/plugins/image-optimizer/settings",
"permission": "extension:manage",
"sort": 30
}
},
"settings": {
"schema": {
"type": "object",
"additionalProperties": false,
"properties": {
"batchSize": {
"type": "integer",
"title": "每批处理数量",
"description": "单次任务最多处理的图片数量(1–200)。",
"minimum": 1,
"maximum": 200,
"default": 50
},
"skipGif": {
"type": "boolean",
"title": "跳过 GIF",
"description": "GIF 转 WebP 后会失去动画,默认跳过。",
"default": true
},
"rewriteContent": {
"type": "boolean",
"title": "优化后回写内容 URL",
"description": "批量优化完成后,自动替换文章/页面中引用的旧图片地址。",
"default": false
},
"cleanupOriginals": {
"type": "boolean",
"title": "优化后删除原文件",
"description": "确认无误后再开启;删除后无法通过旧 URL 访问原图。",
"default": false
}
}
}
},
"permissions": ["file:read", "file:write", "article:read"],
"capabilities": {
"headless": true
}
}