Github+hexo Build Your own blog site (vii) Precautions (avoid overwriting read.me,cname files, manually changing the domain name of GitHub page)

Source: Internet
Author: User

Detailed view of the Hexo blog demo: https://saucxs.github.io/

Bind domain name can be viewed: http://www.chengxinsong.cn

You can view the static files generated on GitHub (if you think you can give a star): Https://github.com/saucxs/saucxs.github.io.git

Note 1: How to avoid the. md file being parsed?

The Hexo principle is that hexo, when executing hexo generate, places a set of static sites generated by the blog into the public folder locally, and copies it to the. Deploy folder when the Hexo deploy is executed. GitHub's repository usually recommends attaching the readme.md documentation, but Hexo will parse all MD files into HTML files by default, so even if you generate a README online. MD, it will also be deleted at your next deployment. How to solve it?

Copy the locally written readme.md file to the. Deploy folder before performing the Hexo deploy, and then perform the Hexo deploy.

Note that the 2:cname file hexo deploy disappears at the next time and needs to be recreated, so it's tedious.

Method One: After each time hexo d , go to the GitHub repository root directory to create a new CNAME file

Method Two: hexo g after that, hexo d copy the CNAME file to the "\public\" directory and write the domain name you want to bind to.

Method Three (recommended): Put content that needs to be uploaded to GitHub in the source folder, such as CNAME, favicon.ico, images, etc., so that it will not be deleted after Hexo D.

Method Four: Permanent retention by installing plug-ins

$ NPM Install Hexo-generator-cname--save

Then add a _config.yml in the

Plugins:-Hexo-generator-cname

It is important to note that if you create a CNAME file on GitHub, you need to clone to local, then install the plugin and deploy it. The CNAME only allows one domain address.

Note 3: The CNAME generated every time is yoursite.com how to solve?

Before every time Hexo D-g will appear to visit the site, you need to manually in the GitHub page setting to reset, the following is the solution.

Modify _config.yml

Url:http://www.chengxinsong.cnroot:/Permalink::year/:month/:d ay/:title/  Permalink_defaults:

Build Hexo+github Series Study:

1, Github+hexo build their own blog site (a) Basic introduction

2, Github+hexo build their own blog site (ii) change the theme Yilia

3, Github+hexo build their own blog site (iii) some basic configuration other than the theme (picture location, article directory function)

4, Github+hexo to build their own blog site (iv) Some basic configuration (statistical configuration, website visit volume display) outside the theme

5, Github+hexo build their own blog site (v) Advanced Configuration (to make blog comments)

6, Ithub+hexo build their own blog site (vi) Advanced Configuration (search engine included, optimize your URL)

Github+hexo Build Your own blog site (vii) Precautions (avoid overwriting read.me,cname files, manually changing the domain name of GitHub page)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.