hexo-blog-manager
Hexo Blog & OSS Resource Manager Skill
This skill defines the standard operating procedure (SOP) dedicated to managing blog posts in the imHansiy/MyHexo repository and the associated static assets / image hosting in the imHansiy/GitHub_Oss repository.
Workflow
1. Image Preparation & Upload (Image Hosting Flow)
When a Hexo post requires an image (screenshot, diagram, asset):
- Target Repository:
imHansiy/GitHub_Oss - Target Path:
img/YY-MM-DD/filename.extension(Use the current date to categorize files). - Steps:
- Read the image file and encode it to Base64.
- Write a JSON payload containing
{"message": "...", "content": "..."}to a temporary file. - Execute the upload using
gh api --method PUT ... --input temp.json.
- CDN Link Format:
https://jsdelivr.007666.xyz/gh/imHansiy/GitHub_Oss@main/img/YY-MM-DD/filename.extension
2. Blog Cover Generation (AI-Powered)
To make the Hexo blog post list look more professional and textured, generate a cover image using Hugging Face Hub:
- Service: Hugging Face Inference API (depends on the
huggingface_hubPython library). - Default Model:
black-forest-labs/FLUX.1-schnell(This model performs best for text rendering and realism). - Steps:
- Prompt Construction: Generate a detailed English prompt based on the Hexo blog title. For example: "A cinematic 16:9 blog cover for [TITLE], tech-futuristic style, vibrant lighting, 8k resolution". If text rendering is needed, use: "In the center, a sign that says '[SHORT_TITLE]'".
- Generate Image: Run the accompanied Python script:
python <SKILL_PATH>/scripts/generate_cover.py "[PROMPT]" cover.png. - User Review (Mandatory): Show the generated
cover.pngto the user and wait for user confirmation before proceeding. If the user is not satisfied, adjust the prompt and regenerate. - Store Assets: Only after user approval, upload the image to the
GitHub_Ossrepository:- Run:
python <SKILL_PATH>/scripts/upload_prep.py cover.png "oss: add blog cover" - Execute:
gh api --method PUT /repos/imHansiy/GitHub_Oss/contents/img/YY-MM-DD/cover.png --input temp_payload.json
- Run:
- Environment Cleanup: After a successful upload, you must delete all locally generated image files, temporary JSON files, and any temporary scripts used during the process.
- Frontmatter Setup: Add the
banner: <CDN_LINK>andheadimg: <CDN_LINK>fields to the Hexo post's metadata (Frontmatter) to configure the cover display in the Hexo environment.
3. Create or Update Hexo Blog Post
- Target Repository:
imHansiy/MyHexo - Target Path:
source/_posts/your-post-title.md - Frontmatter Specification: Must contain header information compliant with Hexo standards:
--- title: Post Title date: YYYY-MM-DD HH:mm:ss tags: [Tag1, Tag2] categories: [Category1] banner: <CDN_LINK> headimg: <CDN_LINK> --- - Image Referencing Convention: The body of the article must always use the jsDelivr CDN links constructed in Step 1.
Rules & Best Practices
- Atomic Commits: Use descriptive commit messages, such as
oss: add screenshot for post Xorfeat: new hexo post about Y. - Base64 Encoding: Always encode binary files (like images) into Base64 format before transmitting them via
gh api. - Bypassing Command Line Limits: Avoid passing huge Base64 strings directly as command-line arguments; always save them to a temporary JSON file and pass them using the
--inputargument. - Result Verification: After uploading, verify that the file successfully exists via
gh apibefore officially writing the image link into the Hexo post.
Applicable Scenarios
This is a Hexo-专用 (Hexo-dedicated) skill. Whenever there is a mention of publishing a blog post, adding an article to Hexo, uploading a cover for a Hexo article, or adding an image to the OSS hosting, this skill should be triggered and applied.
More from imhansiy/my-skills
localtunnel-auto-expose
Automatically exposes local services using LocalTunnel via npx and provides the public URL along with the access password. Use when starting a new service or when external web access is requested.
13cliproxy-manager
Unified management skill for CLIProxyAPI, enabling AI to dynamically update service configurations (API Keys, model aliases, proxy rules) and monitor usage statistics.
7odoo-dev-assistant
Odoo 开发与运维辅助技能。用于处理 Odoo 模块开发、配置排查、数据库操作、账号与权限修复、文档生成等任务。当前已内置重置 Odoo 登录用户 admin 密码、生成模块介绍页文档、识别当前运行数据库与 addons 路径、恢复 Odoo.sh 备份并配置 odoo.conf 等工作流,后续可继续扩展更多 Odoo 场景。
2plantuml-image-generator
Triggered when the user requests an image (e.g., architecture, flowchart, sequence diagram) or needs a technical illustration inserted into a document. This skill dynamically generates and inserts images using the official PlantUML public API.
1odoorpc-agent-skill
>-
1cliproxyapi-manager-skill
>-
1