使用hexo+github搭建个人博客
一、准备工作
- 安装node nodejs.org/en/download…
- 安装git git-scm.com/downloads
- 安装hexo npm install hexo-cli -g
- 注册github账号并创建项目(⚠️这里的账号名字就是你的项目名字,例如:我的账号是cc,项目名:cc.github.io.git)
二、 hexo要上场表演啦
- 构建项目
$ hexo init <项目名称> $ cd <项目名称>$ npm install 启动项目
$ hexo s修改配置_config.yml
//修改标题# Site title: 王新月的博客 subtitle: 前端历程 //修改上传地址# Deployment ## Docs: https://hexo.io/docs/deployment.html deploy: type: git repo: https://github.com/cc/cc.github.io.git branch: master修改source/_posts/hello-world.md,你就得到了下面的页面
三、 hexo已经到达战场
- 装个热更新
$ npm install hexo-browsersync --save - 装个git 支持就能上传了
$ npm install hexo-deployer-git --save - hexo应到达战场
$ hexo g //打包 $ hexo d //上传到github - 输入网址查看
https://cc.github.io.git (cc是你到github用户名)
四、搞个皮肤sou
这里推荐yilia主题
- 下载命令
$ cd ./themes/ $ git clone https://github.com/JoeyBling/hexo-theme-yilia-plus.git ./yilia-plus 修改配置文件
# Extensions ## Plugins: https://hexo.io/plugins/ ## Themes: https://hexo.io/themes/ theme: yilia-plus重新构建并重启
$ hexo g //打包 $ hexo s//重启 $ hexo clean //如果未生效后在重新hexo g $ hexo d //上传到github
如果你想要其他主题可以在官方下载:hexo.io/themes/
王新月的博客
叽里咕噜改配置