Repository navigation
Expand file tree
/
Copy pathplugin.json
More file actions
61 lines (61 loc) · 1.64 KB
/
Copy pathplugin.json
File metadata and controls
61 lines (61 loc) · 1.64 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
59
60
61
{
"$schema": "../plugin.manifest.schema.json",
"id": "hello-world",
"name": "自动摘要",
"version": "1.2.0",
"description": "发布文章时,若摘要为空,从正文或标题自动生成 summary。",
"author": "ReactPress",
"requires": ">=3.5.0",
"server": {
"module": "./dist/index.js",
"hooks": {
"subscribe": ["article.beforePublish"]
}
},
"admin": {
"menu": {
"title": "自动摘要",
"path": "/plugins/hello-world/settings",
"permission": "extension:manage",
"sort": 10
}
},
"settings": {
"schema": {
"type": "object",
"additionalProperties": false,
"properties": {
"enabled": {
"type": "boolean",
"title": "启用自动摘要",
"description": "关闭后,发布时不再自动写入 summary。",
"default": true
},
"maxLength": {
"type": "integer",
"title": "摘要最大长度",
"description": "从正文截取的最大字符数(40–500)。",
"minimum": 40,
"maximum": 500,
"default": 160
},
"suffix": {
"type": "string",
"title": "截断后缀",
"description": "超出最大长度时追加在末尾,例如 …",
"default": "…"
},
"fallbackToTitle": {
"type": "boolean",
"title": "正文为空时使用标题",
"description": "Markdown 正文去格式后为空时,用文章标题作为摘要。",
"default": true
}
}
}
},
"permissions": ["article:read"],
"capabilities": {
"headless": true
}
}