From 54103dfd7d62011fd9b1f0287dae7c0653a1205b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jim=20Liu=20=E5=AE=9D=E7=8E=89?= Date: Thu, 12 Feb 2026 01:56:32 -0600 Subject: [PATCH] refactor(baoyu-post-to-wechat): prioritize coverImage over featureImage in frontmatter lookup --- skills/baoyu-post-to-wechat/SKILL.md | 2 +- skills/baoyu-post-to-wechat/scripts/wechat-api.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/skills/baoyu-post-to-wechat/SKILL.md b/skills/baoyu-post-to-wechat/SKILL.md index 90a625f..cd761a2 100644 --- a/skills/baoyu-post-to-wechat/SKILL.md +++ b/skills/baoyu-post-to-wechat/SKILL.md @@ -204,7 +204,7 @@ Check extracted metadata from Step 3 (or HTML meta tags if direct HTML input). **Cover Image Check** (required for `article_type=news`): 1. Use CLI `--cover` if provided. -2. Else use frontmatter (`featureImage`, `coverImage`, `cover`, `image`). +2. Else use frontmatter (`coverImage`, `featureImage`, `cover`, `image`). 3. Else check article directory default path: `imgs/cover.png`. 4. Else fallback to first inline content image. 5. If still missing, stop and request a cover image before publishing. diff --git a/skills/baoyu-post-to-wechat/scripts/wechat-api.ts b/skills/baoyu-post-to-wechat/scripts/wechat-api.ts index 2d093d2..7691ef1 100644 --- a/skills/baoyu-post-to-wechat/scripts/wechat-api.ts +++ b/skills/baoyu-post-to-wechat/scripts/wechat-api.ts @@ -365,7 +365,7 @@ Frontmatter Fields (markdown): title Article title author Author name digest/summary Article summary - featureImage/coverImage/cover/image Cover image path + coverImage/featureImage/cover/image Cover image path Comments: Comments are enabled by default, open to all users. @@ -555,8 +555,8 @@ async function main(): Promise { let thumbMediaId = ""; const rawCoverPath = args.cover || - frontmatter.featureImage || frontmatter.coverImage || + frontmatter.featureImage || frontmatter.cover || frontmatter.image; const coverPath = rawCoverPath && !path.isAbsolute(rawCoverPath) && args.cover @@ -578,7 +578,7 @@ async function main(): Promise { } if (args.articleType === "news" && !thumbMediaId) { - console.error("Error: No cover image. Provide via --cover, frontmatter.featureImage, or include an image in content."); + console.error("Error: No cover image. Provide via --cover, frontmatter.coverImage, or include an image in content."); process.exit(1); }