From c133234dc82db793485719b41fd41bcfdd0c11d7 Mon Sep 17 00:00:00 2001 From: wangzhuc Date: Wed, 1 Apr 2026 13:37:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20publish=20=E5=91=BD=E4=BB=A4=E6=94=AF?= =?UTF-8?q?=E6=8C=81=20--digest=20=E8=A6=86=E7=9B=96=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=91=98=E8=A6=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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) --- SKILL.md | 4 ++-- toolkit/cli.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/SKILL.md b/SKILL.md index dc94a20..2384e09 100644 --- a/SKILL.md +++ b/SKILL.md @@ -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 diff --git a/toolkit/cli.py b/toolkit/cli.py index f8f5742..ffbe80a 100644 --- a/toolkit/cli.py +++ b/toolkit/cli.py @@ -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")