自动抓取 GitHub 热门项目,生成中文介绍文章
项目根目录提供了 deploy.ps1,右键选择「使用 PowerShell 运行」即可自动完成:
Th1ry.github.io 仓库th1ry.uk脚本运行完后,只需手动去域名服务商添加 DNS 记录即可。
访问 https://github.com/new,仓库名填 Th1ry.github.io,保持 Public。
编辑 _config.yml:
# 修改为你自己的信息
title: 你的博客名
author: 你的用户名
url: https://你的域名.com
在仓库 Settings → Pages → Custom domain 输入 th1ry.uk
在你的域名服务商添加 DNS 记录:
www,目标: Th1ry.github.io@,目标: Th1ry.github.io如果
@不支持 CNAME,改用 A 记录指向:185.199.108.153、185.199.109.153、185.199.110.153、185.199.111.153
# 安装依赖
npm install
# 本地预览
npx hexo server
# 本地生成文章
npm run start
GitHub Actions 会自动:
博客流量起来后(一般需要 1-3 个月):
source/_partial/head.ejs 添加广告代码Th1ryBlog/
├── .github/
│ └── workflows/
│ └── deploy.yml # GitHub Actions 配置
├── scripts/
│ ├── fetch-trending.js # 抓取 GitHub 热门
│ ├── generate-article.js # 生成文章
│ └── create-post.js # 创建文章
├── source/
│ └── _posts/ # 博客文章
├── _config.yml # Hexo 配置
└── package.json # 依赖
MIT