一键导入
publish-post
从用户在对话中提供的文本创建 Hugo 博客文章,自动生成 front matter、运行 check-posts.py 检查、git commit 并 push。当用户贴一段文字并要求发博客、创建文章、发布文章、帮我发到博客、把这段文字变成博客、commit and push 这篇文章时使用。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
从用户在对话中提供的文本创建 Hugo 博客文章,自动生成 front matter、运行 check-posts.py 检查、git commit 并 push。当用户贴一段文字并要求发博客、创建文章、发布文章、帮我发到博客、把这段文字变成博客、commit and push 这篇文章时使用。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when a post from this repository should be appended to an existing Feishu doc or wiki page, especially when the user provides a target wiki/doc URL and wants update semantics with append as the default rather than creating a new child page.
Use when a post from this repository should be published as a new child page under the fixed Feishu wiki node `AI Coding 分享`, especially when the user says 上传到知识库、发到飞书知识库、新建一篇知识库文章、或要把某篇 content/posts 文章发到 AI Coding 分享。
Use when blog post has local images (img/ directory) that need to be visually understood, inserted into the article at appropriate positions, and/or migrated from local relative paths to a GitHub image hosting repository. Triggers: 插入图片, 配图, 上传图片到图床, 图片迁移, 图片外链, insert images, upload to image hosting.
Use when converting PDF files to markdown with embedded images extracted as separate files. Triggered by: "PDF转markdown", "PDF转md", "解析PDF", "提取PDF内容", "提取PDF图片", "convert PDF to markdown", "PDF to md", "extract PDF content".
将 Markdown 文件中的 mermaid 代码块替换为同目录 img/ 下对应的图片引用。 用户已手工将 mermaid 图导出为图片(png/gif/jpeg/webp/svg 等)放入 img/ 目录, 需要自动匹配并替换。 当 markdown 文件中同时存在 mermaid 代码块和 img/ 目录下的图片文件时使用。
| name | publish-post |
| description | 从用户在对话中提供的文本创建 Hugo 博客文章,自动生成 front matter、运行 check-posts.py 检查、git commit 并 push。当用户贴一段文字并要求发博客、创建文章、发布文章、帮我发到博客、把这段文字变成博客、commit and push 这篇文章时使用。 |
| user_invocable | true |
用户在对话中贴出的文本即为文章正文。从中提取元信息,创建 Hugo 博客文章,完成检查、commit、push 全流程。
从用户对话中提供的文本提取:
# ...),没有则用 AskUserQuestion 询问zh 或 en用 AskUserQuestion 向用户确认 slug、tags、categories、description(合并为一次提问)。
跳过条件:用户已明确指定这些信息。
content/posts/YYYYMMDD-slug/(YYYYMMDD 为当天日期)index.md,front matter 模板:---
title: "文章标题"
date: YYYY-MM-DDTHH:MM:SS+08:00
draft: false
lang: zh # 或 en
tags: ["标签1", "标签2"]
categories: ["分类"]
description: "文章摘要"
---
必须遵守:
lang 参数不可省略——中文 zh,英文 en+08:00 时区python3 check-posts.py
确认新文章 lang 正确、字数估算合理。不通过则修复后再继续。
git add content/posts/YYYYMMDD-slug/index.md
git commit -m "$(cat <<'EOF'
add post: 文章标题简述
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
EOF
)"
commit message 前缀 add post:,保持与仓库历史风格一致。
git push
输出文章路径、预估字数、线上 URL https://yousali.com/posts/YYYYMMDD-slug/。
| 用户说 | 行为 |
|---|---|
| "不要 push" / "只 commit" | 跳过 Step 6 |
| "draft" / "草稿" | 设 draft: true |
| 指定了 tags/slug/description | 直接使用,跳过 Step 2 确认 |
| 正文没有标题 | AskUserQuestion 询问标题 |