Build demo

Step 1: Set up a blog on Github

1. Create a new repository on Github and name it xxxxx.github. IO to ensure that you are creating a blog. Then click choose Theme in the GitHub Pages option in the setting of the successfully created Repository and select a theme 3. Go to GitHub Pages and you can find your Git blog address at https://xxxxx.github.io/.Copy the code

Step 2: HexO related operations

Git’s own blog theme is a bit ugly. I chose to use Hexo’s Yilia theme. Next, I will talk about how to use Hexo to build a theme blog. Install hexo

1.1 Setup Environment includes node.js and Git environment, gitHub account configuration (you can download this from the official website and download Git) 1.2 Use Git bash to install HexoCopy the code

Install the Hexo dependency

npm install hexo-cli -g
Copy the code

Then install the component

npm install hexo --save
Copy the code

View the version: The following information is displayed after the success

Hexo -v hexo- CLI: 1.1.0 OS: Windows_NT 6.1.7601 win32 x64 http_parser: 2.7.0 node: 6.11.2 V8:5.1.281.103 UV: 1.11.0zlib: 1.2.11 ares: 1.10.1-DEV ICU: 58.2 modules: 48 Openssl: 1.0.2LCopy the code

2. Configuration hexo

Hexo init xxxxx.github. IO (this is your previous Github blog name)Copy the code

Next you need to connect to Git remotely

Git remote add origin https://github.com/sss(github username)/ XXX (GitHub blog name).github.ioCopy the code

3. Configure Git

Modify the configuration file _config.yml in the editor

## Deployment ## Docs: https://hexo.io/docs/deployment.html deploy: type: git repo: https://github.com/sss(github username)/ XXX (GitHub blog name).github.io. Git branch: masterCopy the code

Then perform

npm install hexo-deployer-git --save
Copy the code

4. The clone yilia theme

Run git bash under xxxxx.github. IO

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

Then modify the theme in the configuration file _config.yml in the editor

##Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: yilia
Copy the code

Also go to the Themes folder and delete the previous blog themes

After setting the theme, deploy to Git:

hexo d -g
Copy the code

4. Start hexo

hexo s
Copy the code

For deployment issues, you can first generate SSH keys on your own host and then add your own SSH keys to Github. To check whether the deployment is successful, run the following command:

ssh -T [email protected]
Copy the code

Success looks like this:

Hi appledusiyong! You've successfully authenticated, but GitHub does not provide shell access.
Copy the code

The third step is to set relevant pages

1. Set your profile picture.Copy the code

If the profile picture is local, save it under themes/yilia/source/img

In the Themes /yilia/_config.yml configuration file add the Settings:

Avatar: /img/girl2_1.jpg 2Copy the code