搭建个人博客

1.下载安装nodejs

2.安装git

3.通过git命令窗口

npm install -g cnpm --registry=https://registry.npm.taobao.org

4安装hexo框架

cnpm install hexo-cli -g 安装hexo框架
hexo -v 查看hexo的版本

5.创建博客目录

在window新建blog目录
E:/github/Myblog

6.进入E:/github/Myblog文件夹下执行

初始化,生成博客文件
hexo init

7.启动博客

本地运行hexo博客
hexo server

8.安装

安装git,发布到github上
cnpm install --save hexo-deployer-git

9.注册github账号

10.建个仓库username.github.io

11.进入-config.yml

注意:每次上传博客,都需要输入账号密码
追加:
deployer
type: git
repo: https://github.com/liuwumin/liuwumin.github.io.git
branch: master

12.部署到github

hexo clean && hexo deploy

13.免账号密码发布博客

13.1 生成公钥
在这里插入图片描述
13.2 找到公钥文件,打开并复制
13.3 登录github,找到setting,创建ssh秘钥
在这里插入图片描述
13.4 修改blog目录文件_config.yml
deploy:
type: git
repository: git@github.com:你的github账户/你的github账户.github.io.git
branch: master
13.5 进入git设置用户名和邮箱
git config --global user.email “you@example.com”
git config --global user.name “Your Name”

14.写博客并发布

14.1 进入source/_posts目录下创建文件写
14.2 启动git(鼠标右击),
hexo clean 清除上次上传博客的缓存
hexo g 生成静态网页
hexo d 发布到github

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值