美文网首页Hexohexo学习
在macOS上使用Hexo+github构建自己的博客

在macOS上使用Hexo+github构建自己的博客

作者: reezon | 来源:发表于2018-04-18 17:06 被阅读10次

在macOS上安装Hexo

首先需要安装nodejs环境

然后运行

$ npm i -g hexo

初始化blog项目

新建一个目录,然后进入目录,运行

$ hexo init

在github上创建博客项目

在github上创建一个如下名字的项目

xxx.gihub.io

配置blog项目的发布方式

安装git发布插件

$ npm install hexo-deployer-git --save

打开文件 _config.xml , 编辑如下内容

deploy:
  type: git
  repo: https://github.com/YourgithubName/YourgithubName.github.io.git
  branch: master

本地运行

运行如下命令

$ hexo clean
$ hexo generate
$ hexo server

部署到github

运行如下命令

$ hexo clean
$ hexo generate
$ hexo deploy

就能自动发布到xxx.github.io了

相关文章

网友评论

    本文标题:在macOS上使用Hexo+github构建自己的博客

    本文链接:https://www.haomeiwen.com/subject/mnqbkftx.html