Hexo builds personal blogs and deploys them to Gitee, the code cloud

Post the link to my blog blog first

After a few days of torment, finally set up a personal blog of their own, mainly used to record their review of things. Now summarize the process of building your own blog. Too lazy to write text, first recommend a reference video: reference video, according to the UP main video operation down the basic OK.

preparation

The first step is to install Node.js and Git, download it from the official website and install it. Be sure to modify the file path and click “Next” along the way. Post two download links first:

Node. Js’s official website

Git mirror or Git website

One caveat is that when installing Node.js, try not to install the latest version, as this will cause some errors when setting up your blog.

Then install an optional editor, such as VS Code. Then install a Markdown editor and recommend Typora.

Install the Hexo blog log

1. Install Node.js and Git 2. Install the Taobao mirror: open CMD and enter

npm install -g cnpm --registry=https://registry.npm.taobao.org

3. Install the Hexo framework:

CNPM install -g hexo-cli hexo-v

4. Start a blog

4.1 Create an empty folder d:/blog, and then CD to the blog folder

4.2 Executing Hexo Init

4.3 View the original blog locally:

Hexo s command, and then open the browser at http://localhost:4000 to see the original Hexo blog

4.4 Create a blog

Hexo New “My First Blog”

4.4.2 Then in the D: blog/source / _posts path you can see the new blog file and write something in it to save it.

4.4.3 After writing the blog, we open CMD in the blog root directory and type

Hexo Clean cleans the cache of the Hexo Server

Go to http://localhost:4000 in your browser and you’ll see the blog we just wrote.

5. Deploy the Hexo blog to GitHub

5.1 First create a new repository on GitHub. Note that the name of the repository must be

IO yourname is your GitHub username.

5.2 Then open CMD input in the blog root directory

cnpm install --save hexo-deployer-git

5.3 Then open the config.yml file in the root directory of the blog and add the following information at the bottom:

Deploy: type: git repo: https://github.com/yysfyu/yysfyu.github.io.git branch: master pay attention to the space

5.4 Deploy to GitHub

The hexo deploy (hexo d) command

Enter your GitHub user name and password. After successful deployment, open your GitHub repository and refresh the following files to see the deployed files. Then enter the repository name in the browser address bar: eg: yysfyu.github. IO to see the deployed blog.

5.5 This is the basic setup and deployment. Then it’s time to modify your personal information and change your favorite themes.

Switch the theme

The Hexo blog replaces the Yilia theme

1. Theme downloads

Under the blog root, type:

git clone https://github.com/litten/hexo-theme-yilia.git themes/yilia

Wait for the download to complete.

2. Theme use: Find the theme in the config file under the root directory of the blog and change it to theme: Yilia

Then Hexo Clean, at which point I encountered a problem as follows:

D:\blog>hexo cl
INFO  Validating config
ERROR {
err: [Error: EISDIR: illegal operation on a directory, read] {
errno: -4068,
code: 'EISDIR',
syscall: 'read'
}
} Plugin load failed: %s hexo-theme-landscape

The solution is to have a package.json file at the root of your blog, find the hexo-theme-landscape line at the bottom and delete it. Then you can triple connect it with one click: hexo clean && hexo g && hexo d

Then visit your github. IO and you’ll see the new blog with the new theme. (Refresh several times to wait)

3. Then there’s personalization.