kennyzir/7deer_skills/auto-page-sync
Claude Code and agent skill by kennyzir/7deer_skills
- community
Checking that the SKILL.md file is still in the repository.
仓库 Markdown/JSON 内容自动同步到前端页面,配置 GitHub Actions 定时拉取 + 部署,保持 Google SEO 内容新鲜度。支持日报、博客、Changelog、Landing Page 等多种页面模式。
Install
npx vskill@latest install kennyzir/7deer_skills/auto-page-syncSKILL.md
Auto Page Sync — 仓库内容自动同步到前端页面
将仓库中的 Markdown / JSON 内容自动同步到前端项目,生成对应页面,并通过 GitHub Actions 定时更新,确保 Google SEO 内容新鲜度。
When This Skill Applies
- 当用户说「把仓库的 XX 目录同步到网站」时
- 当用户说「每天自动更新页面内容」时
- 当用户需要把 Markdown 报告、博客文章、Changelog 展示到前端时
- 当用户提到「SEO 内容新鲜度」「定时更新」「自动部署」时
- 当用户需要配置 GitHub Actions 定时同步内容到前端时
核心价值
手动更新网站内容既耗时又容易遗忘。这个 Skill 让你:
- 只管往仓库写 Markdown,前端页面自动生成
- GitHub Actions 定时拉取,零人工干预
- 每次更新自动触发部署,Google 爬虫看到的永远是最新内容
- 支持多种页面形态,一套机制复用所有项目
Instructions
Step 1: 分析内容源
- 读取用户指定的仓库目录结构
- 识别内容格式(Markdown、JSON、YAML)
- 分析内容组织方式(按日期、按分类、单文件)
- 确定元数据提取规则(标题、日期、标签等)
Step 2: 选择页面模式
根据内容类型选择合适的模式:
| 模式 | 适用场景 | 路由结构 | 特点 | |
|---|---|---|---|---|
| A: 日报型 | 每日报告、周报 | /reports/[date] | 日期导航 + Tab 切换 | |
| B: 博客型 | 文章、教程 | /blog/[slug] | 列表页 + 分类筛选 | |
| C: 动态区块型 | Landing Page 数据 | 更新现有页面区块 | 无新路由 | |
| D: Changelog 型 | 更新日志 | /changelog | 单页时间线 |
Step 3: 创建静态数据管道
将内容文件复制到前端项目的 public/data/ 目录,并生成索引文件。
目标目录结构:
index.json 标准格式:
Step 4: 生成前端页面
根据目标框架生成页面代码。以下以 Next.js App Router 为例:
必须遵循的原则:
- 读取项目现有的
layout.tsx、globals.css、组件库,匹配设计风格 - 使用项目已安装的依赖(如
react-markdown、remark-gfm) - 响应式设计,移动端友好
- 支持暗色模式(如果项目已有)
日报型页面结构(模式 A):
博客型页面结构(模式 B):
内容渲染组件核心逻辑:
Step 5: 添加导航入口
在项目的全局导航中添加新页面链接,使用与现有导航一致的样式。
Step 6: 配置 GitHub Actions 定时同步
创建 .github/workflows/sync_{content_type}.yml:
Cron 时间计算:
- 用户说「每天 X 点(北京时间)」→
X - 8小时 = UTC 时间 - 内容生成时间 + 1 小时 = 同步时间(确保内容已就绪)
- 示例:内容 10:00 生成 → 同步 cron 设为
0 3 * * *(UTC 03:00 = 北京 11:00)
Step 7: SEO 优化(推荐)
- Sitemap 自动更新 — 在同步脚本中追加新 URL,设置
lastmod和changefreq: daily - 页面 Meta 标签 — 从 Markdown 标题提取
<title>和<meta description> - 结构化数据 — 博客型用
Articleschema,报告型用Reportschema - 内容新鲜度信号 — 页面显示「最后更新时间」,可选生成 RSS Feed
Actions
可用资源文件
resources/rebuild_index.py— 通用索引重建脚本,可在 GitHub Actions 或本地运行resources/sync_workflow_template.yml— GitHub Actions workflow 模板,替换占位符即可用resources/report_types_example.json— 报告类型映射示例
完成检查清单
- [ ] 内容文件已复制到
public/data/并可通过 URL 访问 - [ ]
index.json正确列出所有内容条目 - [ ] 前端页面能正确渲染 Markdown(含表格、代码块)
- [ ] 页面风格与项目整体一致
- [ ] 导航栏已添加入口
- [ ] GitHub Actions workflow 语法正确
- [ ] Cron 时间设置正确(注意 UTC 转换)
- [ ] Commit message 包含
[deploy]触发自动部署 - [ ] 无 TypeScript 编译错误
使用示例
示例 1: 每日数据报告
示例 2: 技术博客
示例 3: Landing Page 数据更新
支持的框架
| 框架 | 页面生成 | Markdown 渲染 | 备注 | |
|---|---|---|---|---|
| Next.js (App Router) | ✅ 完整支持 | react-markdown + remark-gfm | 推荐 | |
| Next.js (Pages Router) | ✅ 支持 | react-markdown + remark-gfm | ||
| Astro | ✅ 支持 | 内置 Markdown 支持 | ||
| Hugo / Jekyll | ✅ 支持 | 原生 Markdown | 静态站点 | |
| Vite + React | ✅ 支持 | react-markdown | 需手动路由 |
注意事项
- 内容源和前端项目在同一仓库时最简单;跨仓库需要在 Actions 中配置多仓库 checkout
- 首次同步大量历史内容时注意 Git commit 大小
- 不同部署平台(Cloudflare Pages / Vercel / Netlify)的自动部署触发方式可能不同
- 确保 Markdown 文件使用 UTF-8 编码
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingauto-page-sync/SKILL.md
Popularity
- Repository stars
- 314
- Repository forks
- 141
- 7-day trend score
- 29
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/kennyzir/7deer_skills/auto-page-sync)