Install
openclaw skills install hugo-blog-publisher发布文章到 Hugo 博客。用于当用户说"发布博客"、"推送到blog"、"post to blog"、"发布文章"等。自动完成 front matter 渲染、<!--more--> 标记添加、git 推送流程。
openclaw skills install hugo-blog-publisher将 Markdown 文章发布到 Hugo 博客并推送到 GitHub。
此 Skill 会自动尝试从以下位置读取博客配置:
如果未找到配置,才询问用户。
从用户提供的文章内容中自动提取:
content/posts/{slug}.mddate 字段中指定---
title: "文章标题"
date: YYYY-MM-DD
draft: false
tags: ["tag1", "tag2"]
categories: ["Category"]
description: "文章描述"
---
重要规则:
tech, investment, ai, photo文章 frontmatter 用英文 slug,页面展示用中文,通过 Hugo Taxonomy Branch Bundle 实现:
frontmatter 中使用英文 slug:
tags: ["ssg", "ssr"]
categories: ["tech"]
如果遇到新标签/分类没有映射文件,需要创建:
content/tags/<slug>/_index.md
content/categories/<slug>/_index.md
文件内容极简:
---
title: "显示的中文名"
---
不用 i18n,全部用 _index.md 映射!
| Slug | 中文显示 |
|---|---|
| tech | 技术 |
| photo | 摄影 |
| ai | AI |
| investment | 投资 |
| tech-news | 科技资讯 |
| science | 科学 |
| art | 艺术 |
| life | 生活 |
| reading-notes | 读书笔记 |
| Slug | 中文显示 |
|---|---|
| ai | AI |
| llm | 大语言模型 |
| agent | 智能体 |
| programming | 编程 |
| thinking | 思考 |
| photography | 摄影 |
| camera | 相机 |
| photo | 照片 |
| options | 期权 |
| trading | 交易 |
| investment | 投资 |
| stock | 股票 |
| php | PHP |
| go | Go |
| kubernetes | Kubernetes |
| rag | RAG |
在第一段或导言后添加 <!--more-->,让列表页显示摘要。
位置通常在:
从博客目录自动检测 git 状态并推送:
cd {博客路径}
git add content/posts/{文件名}
git commit -m "新增:{文章标题}"
git push
如果 git push 需要认证,确保用户已配置 SSH key 或 git credentials。
告知用户文章已发布成功。
注意:不要硬编码域名,应该根据用户提供的博客信息返回相应链接。
用户:帮我发布这篇blog(附文章内容)
系统自动完成:
1. 分析内容,提取标题、标签、分类
2. 生成文件名(slug)
3. 添加 front matter 和 <!--more--> 标记
4. 如需新标签/分类,创建 _index.md 映射文件
5. 检测博客目录并推送
6. 返回部署链接