Prerequisite:
- git installed
- node.js installed
- your domain (e.g. buy it from some domain selling website like Godaddy etc.)
- assume your website is built on github pages (i.e. username.github.io)
Step 1: Change the nameservers of your domain
Follow this Youtube video to build the github pages and manage your domain/nameservers.
Step 2: create hexo blog folder
Follow this Zhihu Post, ignore the customizaiton of CNAME section.
Step 3: Add CNAME
After you follow step1, you should acquire a blog on github pages, despite that it's not connected to your webstie because the CNAME is not in the root directory.
Then, do the following:
- Add the CNAME file into
\source
folder (in you local hexo blog folder) - yes, there is no\source
folder in your github (if you already deploy hexo onto github), don't worry the github directory is actually inside the '\source' and that's why you can't see it. - Deploy again using
hexo d
and wait for a while. You will see that your github pages is now connected with your custom domain.