使用Hexo搭建个人博客

霸气de小男生 提交于 2019-11-27 00:29:15

环境准备node.js npm cnpm git(略)

注:右键,以管理员身份进入cmd

安装hexo-cli脚手架

cnpm install hexo-cli

初始化

hexo init

会自动上github上去下载项目

启动

hexo s

新建一篇文章

hexo n “xxxx”

清理下

hexo clean

生成下

hexo g

在github上面部署

创建一个新仓库

注:名字必须是 昵称+github+io

例:chr1043086360.github.io

安装部署的插件

cnpm install --save hexo-deployer-git

打开配置文件

vim _config.yml

修改部署的配置

# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
  type: git
  repo: https://github.com/chr1043086360/chr1043086360.github.io.git
  branch: master

部署成功

chr1043086360.github.io

更换主题

推荐:https://github.com/litten/hexo-theme-yilia 腾讯的大佬开源的

git clone https://github.com/litten/hexo-theme-yilia.git themes/yilia

克隆到自己的 themes/yilia 文件夹下面

再次修改配置

清理下

hexo clean

生成下

hexo g

推到github

hexo d

Bingo 完成

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!