How to host a Hexo Blog on your Windows laptop with server

Since I recently learned about Nodejs, and I will probably focus on nodejs in the foreseeable future, I migrated my blog from Wordpress to Hexo.
Here is a little note about how to install a hexo blog.

Install VSCode

This part you need to do it yourself.

Install scoop

Scoop is a package manager on Windows. Highly suggested.

Type the following into PowerShell to ensure that local scripts are allowed to execute.

set-executionpolicy remotesigned -scope currentuser

Then install Scoop by executing the following command.

iex (new-object net.webclient).downloadstring('https://get.scoop.sh')

Just wait for the script to finish, and once it’s installed successfully, let’s try the following

scoop help

Finally install nodejs with scoop.

scoop install nodejs

Install hexo and git

Use npm to install hexo on your laptop:

npm install -g hexo-cli

Open the folder you want to store your blog data, then create a blog by using the following command:

hexo init [folder] // [folder] = your blog’s path

Open the project folder with VSCode:

npm install

Finally,

hexo s

Open your browser and localhost:4000 to see your website

Create a github repo

Follow the command provided by github:

Push your blog to Github

Every git-push process need the following three commands:

1
2
3
git add .
git commit -m "Your comment"
git push

You can open terminal on VSCode by clicking Ctrl+`

Host on Netlify for free

Well, I am lazy… and Netlify already did the job

To be continues…

How to host a Hexo Blog on your Windows laptop with server

https://blog.kwunlam.com/How-to-host-a-Hexo-Blog-on-your-Windows-laptop-with-server/

Author

Elliot

Posted on

2020-12-18

Updated on

2023-05-07

Licensed under