I’m very happy to re-create my Blog website in MacBook Pro, start it and I’m on my way……

Steps:

  1. Install Node.js and Git, following https://hexo.io/docs, setup video is very clear and helpful;

  2. Run command in terminal to check if Node.js and Git installed well:

    1
    2
    $ node -v        % v.14.16.0
    $ git version % git version 2.20.1 (Apple Git-117)
  3. Install Hexo: in mac, need to add sudo, and input your pwd

    1
    $ sudo npm install -g hexo-cli  

    Run command hexo -v to check current hexo version:

    get successful response: % hexo-cli: 4.2.0 …

  4. Create a local folder as my local Blog repo:

    1
    2
    3
    $ hexo init MyBlog         % (base) Grace~ grace$ 
    $ cd MyBlog % (base) Grace:MyBlog grace$
    $ npm install
  5. Great! It’s all set! Now start blogging!!

    1
    2
    $ hexo new page ***        % create a folder
    $ hexo new post "***" % create a post
  6. The post is a markdown file (.md file), use a Editor to edit it

  7. Run Hexo server to run blog website locally at http://localhost:4000

  8. Change Theme: download a theme you like (via git clone …), clone it to local repro: MyBlog/themes, then modify the theme’s name in _config.yml, Run:

    1
    2
    3
    $ hexo clean
    $ hexo generate
    $ hexo server

    Then view the updated blog at http://localhost:4000

  9. Deploy your blog website via Github Pages

    • Install deployer command to deploy hexo blog to Github

      1
      $ npm install hexo-deployer-git --save
    • In the _config.yml, modify:

      1
      2
      3
      4
      deploy:
      type: git
      repo: https://github.com/GraceCS/gracecs.github.io
      branch: master
    • Config your user email and username for Git account:

      1
      2
      $ git config --global user.email "*****@gmail.com"
      $ git config --global user.name "GraceCS"
    • Update your blog and deploy it to Github by:

      1
      $ hexo d -g

    Need to verify your username of Github and your password to confirm your identity.
    When it shows “INFO Deploy done: git”, it tells you it’s all set!
    You can browse your blog website on-line!