hexo 搭建博客并部署到github上


记录一下今天搭建博客的过程吧!
hexo是基于node的静态博客,需要安装node、git

hexo指令具体使用可查看:https://hexo.io/zh-cn/docs/commands



终端下:
cnpm install -g hexo -cli

cd blog/(目录下生成了blog文件夹,后面的命令都是在blog文件夹下面进行的)

hexo init

hexo server

hexo new 文章名字

dir 查看目录下的文件夹
cd source/_posts/
dir(可以看到_posts下生成了文章的markdown文件,编辑并保存文件)

cd ../..(退回到blog文件夹下)
hexo generator
hexo server (hexo s 也可以)
打开 locahost:4000可以看到博客主页



部署到github上
在github上创建 New repository,设置Repository name,最好是设置成github名字.github.io.git
然后修改blog下的_config.yml文件,将文件最后设置


deploy:
  type: git
  repo: https://github.com/用户名/用户名.github.io.git
  branch: master

终端设置命令:hexo d
最后会提示输入github用户名及密码,输入正确后即可在github 上看到
输入https://tickticktock(你的用户名).github.io即可进入博客主页了



更改博客主题。。。
yilia主题:
https://github.com/litten/hexo-theme-yilia
git clone https://github.com/litten/hexo-theme-yilia.git themes/yilia
更改_config.yml中的theme,
theme: yilia

最后
hexo clean
hexo g
hexo s
hexo d(重新推到git上)
刷新自己的博客,就能看到新的主题了



样式以后自己再慢慢琢磨吧


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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值