返回 Skill 列表
extension
分类: 开发与工程无需 API Key

fix-blog-images

修复和优化未提交的博客文章中的图片。在准备发布博客文章、修复损坏的图片路径、重命名通用图片名称(如image.png)、将图片移动到正确的/images/blog/目录、改进替代文本或在提交前检查图片引用时使用。触发条件为“fix blog images”、“check images”、“prepare post for publish”,或在将截图粘贴到markdown后。

person作者: jakexiaohubgithub

Fix Blog Images

Fixes image issues in uncommitted blog posts before publishing.

Workflow

  1. Run the analysis script:
python3 scripts/fix_blog_images.py --json
  1. Review output and for each issue:

    • rename_and_move: Move image to /images/blog/ with descriptive name
    • improve_alt_text: Update alt text to describe the image content
    • missing_image: Locate or remove the reference
  2. Apply fixes:

    • Move/rename image files to packages/blog/public/images/blog/
    • Update markdown references to use absolute paths /images/blog/...
    • Add descriptive alt text

Image Conventions

  • Location: All images in packages/blog/public/images/blog/
  • Naming: YYYYMMDD-HHMM-descriptive-name.png or YYYYMMDD-descriptive-name.png
  • References: Use absolute paths /images/blog/filename.png
  • Alt text: Describe what the image shows for accessibility

Example Fix

Before:

![alt text](image.png)

After:

![Screenshot showing terminal layout](/images/blog/20251229-post-slug-image.png)

Addtional Notes

Don't try and Optimize Images. a git hook will run image optimization on commit. This skill is just to fix paths, names, and alt text before committing.