hexo快速搭建博客

hexo快速搭建博客

hex主页: https://hexo.io/zh-cn/

1.安装创建并启动

#创建一篇新文章
$ hexo new “My New Post”

$ hexo init blog

$ cd blog

$ npm install

#运行静态服务器
$ hexo server -s

2.发布

这里简介使用github发布博客

#安装git插件:
$ npm install hexo-deployer-git --save

在自己github上创建一个新项目
新项目名称需要是 xxx.github.io (你的用户名.github.io)
github上创建的这项目记得在配置GitHub Pages下 choose a theme

#生成静态文件
$ hexo generate
将本地博客项目上传到github上创建得这项目
修改更目录_config.yml文件内容
deploy:

  • type: git
    repository: [email protected]:xxxx/blog.git #github上项目地址
    branch: master

#执行部署
$ hexo deploy
成功即可在https://xxxx.github.io/ 看见所搭建的博客

若不成功

#清空生成的静态文件
$ hexo clean
#再次生成生成静态文件
$ hexo generate
#再次执行部署
$ hexo deploy

猜你喜欢

转载自blog.csdn.net/tangkebo/article/details/86140502