Welcome to Hexo! This is my very first post. Check documentation for more info. So you know that Hexo is a Blog Framework.

Quick start follow my step.

喵喵图

Create local hero server

1
2
3
4
5
$ npm install -g hexo-cli ##install hexo
$ hexo init <hexo init folder path> ##initial hexo
$ npm install ##install npm
$ npm install --save hexo-deployer-git ##install git plugin
$ hexo s ## start your loacal hexo server -http://localhost:4000

Deploy to Github pages

  1. 創建GitHub账户,添加SSH Key ;

    1
    2
    3
    $ ls -al ~/.ssh ##查看电脑是否存在id_rsa.pub 或 id_dsa.pub
    $ pbcopy < ~/.ssh/id_rsa.pub ##是-复制SSHkey到剪切板
    $ ssh-keygen -t rsa -C "github-email" ##否-创建SSHKey 回车输入开机密码 即可;完成后粘贴至[GitHub](https://github.com/settings/keys)
  2. 在Github创建公共仓库【github-account-name.github.io】

  3. 修改HEXO 配置文件

    folder>/_config.xml
    1
    2
    3
    4
    5
    ## Docs: https://hexo.io/docs/deployment.html
    deploy:
    type: git
    repo: git@github.com:<Github账号名称>/<Github账号名称>.github.io.git
    branch: master
  4. 部署到远端网页

    1
    $ hexo g -d  ## generate static file and deploy

Visit remote sites - https://github-account.github.io

thanks for your reading~