博客
关于我
在Windows下使用Hexo+GithubPage搭建博客的过程
阅读量:431 次
发布时间:2019-03-06

本文共 893 字,大约阅读时间需要 2 分钟。

Windows环境下Hexo+GitHub Pages搭建个人博客

1. 安装Node.js

下载Node.js即可安装,推荐使用LTS版本。安装完成后,通过node -v验证是否安装成功。

2. 安装Git

下载Git安装包,进行安装。通过git --version确认安装状态。

3. 注册GitHub账号

访问GitHub官网注册账号,注册完成后记得添加SSH Key,以便后续代码提交。

4. 生成SSH Key

打开Git Bash,执行命令:

ssh-keygen -t rsa -C "你的邮箱地址"

生成两个文件:id_rsaid_rsa.pub。将id_rsa.pub添加到GitHub账号的SSH设置中。

5. 搭建Hexo博客

创建一个空的文件夹,右键选择Git Bash,输入命令安装Hexo:

npm install -g hexo

初始化Hexo项目:

hexo init

进入项目目录,安装依赖:

cd hexonpm install

生成部署文件并启动服务器:

hexo generatehexo server

6. 配置GitHub Page

登录GitHub,新建一个仓库,仓库名为<你的GitHub用户名>.github.io。启用GitHub Pages,选择模板并发布。

7. 将Hexo项目托管到GitHub

修改hexo/_config.yml,添加部署配置:

deploy:  type: git  repository: git@github.com:你的GitHub用户名/你的GitHub用户名.github.io.git  branch: master

安装Hexo Deployer插件:

npm install hexo-deployer-git --save

每次修改后执行:

hexo cleanhexo generatehexo deploy

8. 调试与优化

确保所有配置正确,部署后访问GitHub Pages查看效果。如有问题,可返回项目目录检查配置文件或重新启动服务器。

通过以上步骤,成功搭建并部署个人博客。

转载地址:http://ujfyz.baihongyu.com/

你可能感兴趣的文章
POJ 3041 Asteroids(二分匹配模板题)
查看>>
Qt笔记——标准文件对话框QFileDialog
查看>>
poj 3083 Children of the Candy Corn
查看>>
POJ 3083 Children of the Candy Corn 解题报告
查看>>
POJ 3253 Fence Repair C++ STL multiset 可解 (同51nod 1117 聪明的木匠)
查看>>
Qt笔记——控件总结
查看>>
poj 3262 Protecting the Flowers 贪心
查看>>
poj 3264(简单线段树)
查看>>
Qt笔记——布局管理三件套分割窗口、停靠窗口和堆栈窗口
查看>>
poj 3277 线段树
查看>>
POJ 3349 Snowflake Snow Snowflakes
查看>>
POJ 3411 DFS
查看>>
poj 3422 Kaka's Matrix Travels (费用流 + 拆点)
查看>>
Qt笔记——官方文档全局定义(二)Functions函数
查看>>
POJ 3468 A Simple Problem with Integers
查看>>
poj 3468 A Simple Problem with Integers 降维线段树
查看>>
poj 3468 A Simple Problem with Integers(线段树 插线问线)
查看>>
poj 3485 区间选点
查看>>
poj 3518 Prime Gap
查看>>
poj 3539 Elevator——同余类bfs
查看>>