博客
关于我
在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_rsa和id_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/

你可能感兴趣的文章
python4.0 gil_Python 并发编程系列--1、浅谈GIL历史及对多线程的影响
查看>>
python60行绘图程序_天底下最简单的QT画图板,就一个类,60行代码
查看>>
Python: AES加密与解密
查看>>
Python: Range() 最大尺寸;动态的还是静态的?
查看>>
Python: Windows下用 multiprocessing 的深坑
查看>>
python:Could not find platform independent libraries <prefix>解决方法
查看>>
Python:datetime tzinfo 时区名称文档
查看>>
Python:deepcopy(list) vs new_list = old_list[:]
查看>>
Python:Google API - 从消息中获取 mimeTypes
查看>>
Python:Google API - 从消息中获取 mimeTypes
查看>>
Python:subprocess.call,stdout to file,stderr to file,在屏幕上实时显示stderr
查看>>
Python:TypeError:无法连接“str“和“int“对象
查看>>
Python:XPath 在 ElementTree 中不可用
查看>>
Python:从 FTP 服务器下载文件
查看>>
python:从列表中创建元组列表
查看>>
Python:从嵌套列表中删除重复项
查看>>
Python:从间隔映射到值
查看>>
Python:使用 shell=False 的子进程调用不起作用
查看>>
Python:修改 PATH 环境变量的平台无关方式
查看>>
Python:假与 0
查看>>