Introduction to the

About Hexo + About Gitee

Demo site, this is my own built, please refer to — — fangxiansheng123. Gitee. IO/myhexoblog /

Hexo is a Static blog framework based on Node.js. It is easy to install and use, and can easily generate static web pages hosted on GitHub and Coding. Hexo is the preferred framework for building blogs. You can visit Hexo’s official website for more details, because the creator of Hexo is Taiwanese and friendly to Chinese, you can choose Chinese for viewing.

Gitee is a hosted code platform that generates its own static website. You can build your own static blog in the local computer first, and then upload it to the free server gitee code cloud as a static server to use your website through git command.

 

1. Installation and deployment

1.1 — Hexo’s most complete build tutorial ever

See this article: blog.csdn.net/sinat_37781…

1.2 — Hexo blog posts and basic operations

Please look at this article: zhuanlan.zhihu.com/p/156915260

1.3 — Hexo + Gitee (Code Cloud) builds personal blog

See this article: blog.csdn.net/weixin_4563…

 

You can refer to the command line above, and here is my own summary. In accordance with the order to everyone slowly try, specific access to above data!

NPM install hexo-cli -g // hexo init blog // initialize project hexo clean // Clean existing hexo website file hexo generate(can be short for g) // Generate a new web file hexo server(can be shortened to s) based on the web file and the new CSS style NPM install hexo-deployer-git --save to create an article, the md file in the root directory source can change the article content. To publish articles, hexo g --d // Publish articles one-click deployment and push to the Gitee repositoryCopy the code

 

 

2. You run into problems

2.1 — Hexo is deployed in the code cloud without styling issues

Localhost :4000 is running correctly as shown in the following figure:

After uploading to Gitee, the home page of the re-code cloud will be shown as follows:

 

 

The solution

Find the URL and root in _config.yml in the root directory

# url: yoursite.com

root: /

Change the URL to an address in your code cloud

Example:

Change root to your repository name and mine to myhexoblog

Url modification as shown below, copy

 

Enter the commands hexo G and hexo d to update the repository

Click Update to redeploy Gitee Pages in the Gitee Pages service

Once the update is complete, it will load normally

2.2 — The name and path of the warehouse in the code cloud should be consistent and changed to JavaScript

First of all, we need to register the code cloud account, and then create a warehouse, here the first time to use the code cloud can, first take a look at the code cloud entry of course, registered account we can directly enter the code cloud official website: gitee.com/ is a Look at the kind of… Note the big hole in creating a repository: repository name, language used (JavaScript), access rights (public)

2.3 — -_config. yml Leave Spaces

As a small white I, successfully fell into this pit to climb for several days, did not climb out, finally ask god to help, just found that is the reason here. At that time, write the warehouse name is not my user name, resulting in the deployment path of code cloud Pages is wrong, resulting in the relative path is not correct, can not read CSS style and JS running files, all into the look like this, so the alarm is not to pit

To modify the configuration file, go to the blog home directory and open _config.yml to configure it, and find here at the bottom of the code

What it looks like after modification,

Pay special attention to there is a hole: modify the code time attention Spaces, such as the repo: behind are Spaces, remove the Spaces, complains when I was running behind, this is the provisions of the code, and deploy must start from the beginning of a line to write, do not add a space, pay attention to the format

3. You’re done

More programming knowledge learning and resources in the public account [Viewsonic Programming]

Thank you for watching and “like”, I wish you all a successful career, academic progress, happy!

Encounter a problem do not understand can communicate with each other! The original address: wp. Fang1688. Cn/study / 253. H…