本文へ移動
cccskills
無料GitHub で公開

wjs-publishing-hugo

当用户想给自己的 Hugo 静态博客(如 maggiacito.com)新增或编辑帖子、管理类目、上传图片并发布上线时使用——对话式后台,说一句就改文件、commit、推送、自动部署,不需要任何 CMS/服务器。

触发词:「发一篇博客」「给 Hugo 加文章」「写篇帖子到博客」「管理博客类目」「上传图片到博客」「博客后台」「/wjs-publishing-hugo」。

インストール方法を見る

含まれるファイル(6)

  • SKILL.md4.7 KB
  • README.md5.0 KB
  • scripts/add-image.py2.6 KB
  • scripts/categories.sh577 B
  • scripts/new-post.py3.5 KB
  • scripts/publish.sh833 B

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

wjs-publishing-hugo

Hugo 博客的对话式后台。我就是后台——没有 CMS、没有 /admin 页面、没有 PAT、没有 Cloudflare。 你说要发什么,我按仓库约定改 content/、放图、commit、push,走仓库现有部署流自动上线。

适用:maggiacito.com 这类 Hugo 站(content/posts/*.md + categories/tags taxonomy + GitHub Pages Actions 部署)。其它 Hugo 仓库也能用,先按下面「前置检测」对齐约定。

前置检测(每次开工先做)

  1. 确认在 Hugo 仓库根:有 hugo.toml(或 config.toml)和 content/。不在就让用户给路径。
  2. 读 hugo.toml:拿 timeZone、[taxonomies](确认 categories/tags)。
  3. 看一篇现有帖子的 front matter(content/posts/ 里随便挑一篇),确认字段与下面「权威格式」一致; 不一致就以仓库现状为准,别套用本文档的默认。

帖子的权威格式(maggiacito 现状)

文件:content/posts/<slug>.md。front matter 严格如下,日期用 YYYY-MM-DD HH:MM:SS(Asia/Shanghai):

---
title: "标题"
date: 2026-06-04 21:30:00
lastmod: 2026-06-04 21:30:00
categories: ["知天命"]
tags: []
url: /知天命/标题/
---

正文 markdown……
  • url 显式写 /<主类目>/<标题或slug>/(沿用 WordPress 迁来的链接风格;类目和标题可含中文)。
  • categories / tags 是字符串数组,可空 []。
  • 不要手写 front matter——用 scripts/new-post.py 生成,格式才不会漂。

工作流

1. 新增帖子

拿到标题 + 正文(用户给草稿/链接/零散思路都行;要润色按需润),选好类目,然后:

echo "<正文 markdown>" | python3 <SKILL_DIR>/scripts/new-post.py \
  --repo <仓库根> --title "标题" --category "知天命" --slug 可选英文slug

脚本生成 content/posts/<slug>.md 并打印路径。不传 --slug 时按标题派生文件名(中文也行,文件名读者看不到)。 不传 --url 时默认 /<首个类目>/<标题或slug>/。需要别的链接用 --url 覆盖。

2. 编辑帖子

直接改对应 content/posts/*.md:改正文随意;改了内容把 lastmod 更新成当前时间,date 不动。

3. 管理类目

  • 先列现有类目给用户挑(避免造重复):bash <SKILL_DIR>/scripts/categories.sh <仓库根>
  • 新类目:现场加进帖子的 categories[] 即可,Hugo taxonomy 自动建 /categories/<名>/ 页,无需别的配置。
  • 改名/合并类目:扫所有 content/posts/*.md 的 categories[] 批量替换(这是 CMS 做不到、我能做的)。改完提醒用户旧的 /categories/<旧名>/ 链接会失效。

4. 上传图片

新图放 static/uploads/<年>/(served 为 /uploads/...);老的 static/wp-content/uploads/ 不动。

python3 <SKILL_DIR>/scripts/add-image.py <本地图片> --repo <仓库根> --alt "说明"

打印一行 markdown 图片链接,插进正文。超 2000px 宽的图会用 macOS sips 自动缩小。

5. 发布上线

本地预览(可选):hugo server -D → 看 http://localhost:1313 。 确认后发布:

bash <SKILL_DIR>/scripts/publish.sh "post: <标题>" <仓库根>

普通用户的 git push 会触发 deploy.yml(on: push)构建上线——只有反馈机器人那种 GITHUB_TOKEN 推送才会被 GitHub 防递归挡掉,你自己推不受影响。push 完可 gh run watch 看部署。

范围(YAGNI)

只做:新增/编辑帖子、管理类目、上传图片、发布。不做评论、用户管理、草稿工作流、定时发布。

常见错误

  • ❌ 手写 front matter 导致日期格式/字段漂移 → ✅ 一律走 new-post.py。
  • ❌ 图片塞进 static/wp-content/uploads/(那是迁移来的历史目录)→ ✅ 新图进 static/uploads/。
  • ❌ 改了帖子忘了更 lastmod → ✅ 编辑后同步 lastmod。
  • ❌ 造了和现有同名/近义的类目 → ✅ 先 categories.sh 看一遍再定。
  • ❌ 以为 push 不会自动部署(被反馈闭环那条 GITHUB_TOKEN 限制误导)→ ✅ 你本人 push 会触发 deploy.yml。
  • ❌ 设了会撞车的 url(和已有帖子重复)→ ✅ 用 categories.sh/grep 查重,必要时 --url 指定唯一路径。

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

王建硕的思维框架与表达方式。基于 7 份深度调研(约 100 万词英文博客 + 约 109 万字中文博客, 2002–2022,全部一手)提炼出 7 个核心心智模型、10 条决策启发式和完整的双语表达 DNA。 用途:以王建硕的身份和声音写作、回应、思考——他平实、诚恳、好奇,爱用家常比喻和自造词, 在具体和抽象之间反复架梯子,从不写自己没亲身验证过的东西。 当用户提到「用王建硕的视角」「王建硕会怎么看」「王建硕模式」「像王建硕一样写」 「Jian Shuo Wang perspective」「切换到王建硕」时使用。 即使用户只是说「帮我用王建硕的角度想想」「如果是王建硕会怎么写这篇」也应触发。 一旦激活,本次对话后续所有回应都保持王建硕身份,直到用户明确说「退出」—— 不需要每轮重新点名。 不适用:用户要的是关于王建硕本人的客观介绍 / 事实查询(「王建硕是谁」「他哪年创业的」), 那种问题正常回答即可,不要进入角色扮演。

日本語の概要は準備中です。原文の説明を表示しています。

jianshuo/claude-skills1312026年8月21日 更新

Use when the user asks to audit what's wrong with a project, "make it right", "看看项目出了什么问题", "为什么用户的需求还没上线", "为什么没提交App Store", "为什么没新build", or wants a holistic state-of-the-project check covering unmerged branches, stalled PRs, failed GitHub Actions, stale builds, plan drift (TODOS.md / ROADMAP), unreleased commits, and log errors. Runs read-only investigation, presents a grouped checklist, fixes only after explicit user confirmation. Aware of the Cathier iOS app workflow (Xcode + fastlane + auto-merge @claude PRs from in-app feedback).

日本語の概要は準備中です。原文の説明を表示しています。

jianshuo/claude-skills1312026年8月21日 更新

Use when the user has a video + an SRT and wants the subtitles either burned into the pixels (libass, always-visible) or soft-muxed as a togglable track. Also handles the final composite step for the localization pipeline — burn subs, mix a dub track, and keep the original audio as a low-volume bed, all in ONE ffmpeg encode (no cascade). Verifies libass availability and auto-downloads a static evermeet ffmpeg build when Homebrew's stripped binary lacks it. Triggers — "烧字幕", "硬字幕", "burn subtitles", "burn-in subs", "embed subtitle", "soft mux SRT", "把字幕烧进视频", "做最终合成".

日本語の概要は準備中です。原文の説明を表示しています。

jianshuo/claude-skills1312026年8月21日 更新

Use when the user complains about spam on his X/Twitter posts — 同城面付 / 寻固炮 / 线下上门 / 免费破处 这类引流号在他推文下刷的 emoji 垃圾回复 — and wants them removed. Covers the last 7 days (X recent-search window). Triggers — "把这些spam删掉", "清理X垃圾回复", "推文下面好多引流号", "clean spam replies", "/wjs-cleaning-spam".

日本語の概要は準備中です。原文の説明を表示しています。

jianshuo/claude-skills1312026年8月21日 更新

Use when the user wants a 王建硕-style WeChat article (article.md) turned into a narrated short MP4 video — TTS voiceover via 火山引擎 Volcano TTS, HyperFrames CSS/GSAP animation per scene, subtle SFX, abstract watercolor background, full pipeline rendering to 1080×1920 portrait MP4 (30-90s). Triggers — "把这篇文章做成视频", "做一个解说视频", "讲解视频", "/wjs-converting-text-to-video".

日本語の概要は準備中です。原文の説明を表示しています。

jianshuo/claude-skills1312026年8月21日 更新

Use when migrating a WordPress site to a Hugo static site on GitHub Pages from a WXR export (.xml) plus the wp-content/uploads folder — preserving /archives/<id>/ URLs, localizing images, and deploying via GitHub Actions. Triggers — "把 WordPress 迁成 Hugo", "wordpress 转静态站", "migrate WordPress to Hugo", "WXR to Hugo", "publish WordPress to GitHub Pages", "/wjs-converting-wp-to-hugo".

日本語の概要は準備中です。原文の説明を表示しています。

jianshuo/claude-skills1312026年8月21日 更新

jianshuo のスキルをすべて見る

このスキルの問題を報告する