Transfer Hexo Blog from Windows to Mac

My old laptop died last week after working for me for five years. And I bought a new M1 mac the next day. It is not hard to transfer hexo blog to a mac. The following are steps I take.

Step 1 Install git, node and hexo

1
2
3
brew install git
brew install node
npm install hexo g

Step 2 Initialize a hexo folder

Create a new folder for it and then call new terminal at folder with hexo init and git init.

Test the new folder with hexo s.

Step 3 Download your old hexo _post, themes folders and _config.yml

I used google drive for this. Compress them and then download. Replace the ones with them.

Step 4 Change your privilege level

First get info of your blog folder, make sure you have privilege to write to it.

And then use sudo chmod -R 777 testproject to change the permission level of your project directory.

Step 5 Configure git and add SSH

If you have configured git before, ignore this step.

1
2
git config --global user.name "username"
git config --global user.email "email@gmail.com"

Then generate your SSH.

1
ssh-keygen -t rsa -C "email@gmail.com"

You can find the generated SSH in ~/.ssh/id_rsa.pub.

.ssh is a hidden folder. You can open it with open ~/.ssh // . Find id_rsa.pub there, and then add SSH to your GitHub account.

Or you can use cat ~/.ssh/id_rsa.pub to print the key and then copt it.

Step 6 Deploy your blog

1
2
hexo g
hexo d

Input your github user name. As for the password, you should input your personal access code rather than your password anymore.

You can find more info about personal access code here. https://stackoverflow.com/questions/68775869/support-for-password-authentication-was-removed-please-use-a-personal-access-to