抱歉,您的浏览器无法访问本站

本页面需要浏览器支持(启用)JavaScript


了解详情 >

配置环境

  1. 下载安装 Node.js
  2. 下载安装 Git

安装 Hexo

本地磁盘新建一个博客目录,执行命令:

$ npm install -g hexo-cli

初始化博客

$ hexo init
$ npm install(安装依赖模块)

安装完成后的目录

.
├── _config.yml
├── package.json
├── scaffolds
├── source
|   ├── _drafts
|   └── _posts
└── themes

本地浏览

$ hexo g(生成静态文件)
$ hexo s(本地测试)

然后打开:http://localhost:4000 即可浏览。

配置发布

打开 _config.yml 文件

deploy:
  type: git
  branch: master
  repo:
      github: git@github.com:用户名/用户名.github.io.git
    coding: https://e.coding.net/用户名/仓库地址.git

执行: $ hexo d 即可发布到仓库。

评论