Create the personal blog based on Hexo

Shixi 2021-04-08 08:50:54
Categories: Tags:

Step 1

Download


We will use Git and Node.js to deploy and manage your blog.

Quick start


Install hexo
npm install hexo-cli -g
hexo init blog
cd blog
npm install
hexo server
Update your blog
hexo new "postname"
hexo g
hexo s
hexo d

Warning:The preview site is temporary, you must connect it to the Github Pages to show in the Internet.

Step 2

This section will show you how to connect your blog with the Github.

Establish your repository


Such as “yourname.github.io

Edit config.yml


open _config.yml_,add the following texts:

deploy:
   type: git
   repo: url
   branch: gh-pages

You can copy the url in the button called CODE in your github.

Connect to your prefered domain name (Optional)


This is an optional step. If you do not have such a domain name, you can also access your blog with the original site like “yourname.github.io

Config

Add SSH keys

Open your blog folder with git bash and enter the following code:

 ssh-keygen -t rsa -C "youremail@youremail.com"

The results will be:

Enter file in which to save the key:

Enter passphrase(empty for no passphrase):

For convenience, you could press Enter to skip these steps.

Step 3

Congradulations! You have sucessfully created your personal blog. But how to make it more personalized?

Open hexo, clone your preferred theme.