fix: publish 命令支持 --digest 覆盖自动摘要

- cli.py publish 新增 --digest 参数,优先使用传入值,否则回退自动截取
- SKILL.md Step 5 摘要限制从 ≤54 字改为 ≤40 字(对齐微信 120 UTF-8 字节限制)
- SKILL.md Step 7 publish 命令模板补上 --digest

Closes #8

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
wangzhuc 2026-04-01 13:37:23 +08:00
parent 579b8d04ed
commit c133234dc8
2 changed files with 4 additions and 3 deletions

View file

@ -325,7 +325,7 @@ LLM 自行完成,不需要调用脚本。
读取: {skill_dir}/references/seo-rules.md
```
**5.1 SEO**3 个备选标题 + 摘要(≤54 字)+ 5 标签 + 关键词密度优化
**5.1 SEO**3 个备选标题 + 摘要≤40 字)+ 5 标签 + 关键词密度优化
**5.2 质量验证**(两个维度,每项逐一检查):
@ -412,7 +412,7 @@ Converter 自动处理CJK 加空格、加粗标点外移、列表转 section
```bash
# 发布
python3 {skill_dir}/toolkit/cli.py publish {markdown} --cover {cover} --theme {theme} --title "{title}"
python3 {skill_dir}/toolkit/cli.py publish {markdown} --cover {cover} --theme {theme} --title "{title}" --digest "{digest}"
# 降级:本地预览
python3 {skill_dir}/toolkit/cli.py preview {markdown} --theme {theme} --no-open -o {output}.html

View file

@ -121,7 +121,7 @@ def cmd_publish(args):
# Create draft
title = args.title or result.title or Path(args.input).stem
digest = result.digest
digest = args.digest or result.digest
draft = create_draft(
access_token=token,
title=title,
@ -388,6 +388,7 @@ def main():
p_publish.add_argument("--cover", help="Cover image file path")
p_publish.add_argument("--title", help="Override article title")
p_publish.add_argument("--author", default=None, help="Article author")
p_publish.add_argument("--digest", default=None, help="Override article digest (≤120 UTF-8 bytes)")
# themes
sub.add_parser("themes", help="List available themes")