moerjielovecookie

Sawen_Blog

一个普通工科牲的博客网站
x
github
follow
email

The issue of the personal domain bound in the page disappearing after hexo d when deploying hexo to GitHub Pages.

After deploying the Hexo blog to GitHub page, you can bind your own domain name in the page settings, but I found that after updating the blog, the bound domain name disappears and reverts to the original githubio domain name. Later, I discovered that a CNAME file needs to be added in the repo, with the content being the domain name bound in the page:
image
However, this way, the CNAME file will disappear after each deploy. Then I placed this file in the public folder within the local hexo folder, so that after deploy, the CNAME file would be pushed to the GitHub repository along with other HTML files. It seemed to solve the problem, but when debugging the theme, running hexo clean caused the public folder to be deleted, and the CNAME file was gone again. In the end, I learned that when executing hexo g, the files in the source folder are compiled, so placing the CNAME in the source folder perfectly resolves the issue.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.