0%

Restart the blog still with hexo

Why do I restart a new one?

It’s more than a year that I didn’t update the blog and lolts of the info are hard to remember if you didn’t do it frequenlty and routinely. It’s really important to write something down that really important for you. In the past, I also write down some unrelated articles. But the time is limited, it’s hard to find the right Therefore, I restart a new blog style trying to record and share what I learn as a reference.

I know there are plenty of note software or services that publish articles conveniently, and some of the blog frames, like WordPress, are also easy to build up. However, it’s also enjoyable to make some handmade progress and make progress quickly.

Install Hexo

  1. Install Git
  2. Install Node.js through nvs from the Github releasing page. (Hexo service is based on GitHub; nvs is the node.js version management tool for Windows OS recommend by Hexo officially.)
  3. Open PowerShell and type nvs, select the LTS version (e.g. the version with the name like Gallium) and install it. Note: need to start the
  4. Install Hexo with the command npm install -g hexo-cli
  5. Check the version through hexo -v

Generate a new blog & upload to the GitHub

  1. Create a new local file location
1
2
3
$ hexo init <folder>
$ cd <folder>
$ npm install
  1. Create a testing Hexo frame throughhexo g and then hexo s. ”g” means generate, s means server. Now, you create the first Hexo blog page!

  2. Open the file _config.yml in your blog folder to set the info link to GitHub (Note: recommend installing an editor software like VS code or Notepad++ for the enhanced function). The configuration should be like the following:

    1
    2
    3
    4
    5
    6
    deploy:
    type: git
    repo: <https://github.com/><username>/<project>
    # example, <https://github.com/hexojs/hexojs.github.io>
    branch: gh-pages
    # change the branch name to master if you are lazy.
  3. Setup the SSH keys

  4. Upload the blog with hexo d

  5. The blog name should be like https://[username].github.io/[branch name]/

Install useful packages

  • npm install hexo-deployer-git --save

    Deploy the blog to GitHub

Using Hexo in Windows

This section is to record how to start the hexo environment in Windows. we need to start the node.js first under nvs commend.

  • Open the Windows Powershell (Or just right click the “open Terminal” from the options in the folder in explorer) in the blog folder where you generate the Hexo blog.

  • Launch nvs and select the proper node.js version (The version that I install the node.js)

  • Can start to commend Hexo like hexo s; hexo g; hexo d…etc.

    • S for server (run the blog in the local machine)

    • g for generate (generate the static blog website for uploading)

    • d for deploy (deploying the context to the internet)

Reference

Note

  • python3 -m http.server