Hexo 博客搭建
Hexo 博客搭建
假设系统用户名为test
Github账号为 test@163.com
1. 在 Linux 系统中安装 Git
sudo apt-get install git-core
2. 在 Linux 系统中安装 Node.js
以 Node.js v19.x为例
curl -fsSL https://deb.nodesource.com/setup_19.x | sudo -E bash - &&\
sudo apt-get install -y nodejs
3. 安装 Hexo
sudo npm install -g hexo-cli
4. 执行 Hexo
创建并进入工作目录,如 ~/Hexo
:
cd ~
mkdir Hexo
cd Hexo
使用 hexo init
新建 Hexo 项目:
hexo init my-hexo-site
cd my-hexo-site
npm install
5. 创建帖子
hexo new "hello hexo"
在 hello-hexo.md 中编写文章
6. 创建 Github 仓库
创建 Githubi 仓库,比如 my-hexo-site
7. 配置 Github 账户
7.1 生成 SSH Key
git ssh-keygen -t ed25519 -C "test@163.com"
Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/test/.ssh/id_ed25519): [Press enter]
Created directory '/home/test/.ssh'.
Enter passphrase (empty for no passphrase): [Press enter]
Enter same passphrase again: [Press enter]
Your identification has been saved in /home/test/.ssh/id_ed25519
Your public key has been saved in /home/test/.ssh/id_ed25519.pub
The key fingerprint is:
SHA256:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx your_email@example.com
The key's randomart image is:
+--[ED25519 256]--+
| |
| |
| |
| |
| |
| |
| |
| |
| |
+----[SHA256]-----+
7.2 将 public key 添加到 Github
打开 Github 的 Settings
将 /home/test/.ssh 内容添加到 SSH Key
8 配置 Git 提交的账户
git config --global user.email "test@163.com"
git config --global user.name "test"
9. 将 Hexo 推送到 Github 仓库
cd my-hexo-site
git init
git remote add origin git@github.com:test/my-hexo-site.git
git add .
git commit -m "first commit"
git branch -M main
git push -u origin main
10. 使用 Cloudflare Page 部署 Hexo
创建一个 Page 项目
连接到 Github
开始配置
配置构建参数
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· 什么是nginx的强缓存和协商缓存
· 一文读懂知识蒸馏
· Manus爆火,是硬核还是营销?