When deploying the blog, Why my readme file is missing again?

I have met this issue when deploying the blog to github. So, let's take a look how to solve it.

Reason

  1. After we execute the command hexo g, the .md format file in the source file will be rendered as an html file and placed under 'public' folder;
  2. After continuing to execute the command hexo d, all files under 'public' folder will be submitted to the corresponding XXX.github.io repo;
  3. Since there is no README.md file in the local public folder, github will believe that you have deleted the README.md file when submitting the public file, and github will also delete the README.md file in the repo.

How to solve

We create a new README.md file in the local source file. 1. Modify the _ config.yml file in the root directory of Hexo; 2. Set the value of the skip_render parameter to README.md (Adding this setting is to tell the hexo parser that you skip the README.md file when rendering the md file in the source folder).

references

[1] https://blog.csdn.net/wxl1555/article/details/79291865.