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
- Use
hexo sto preview your blog in local server ‘http://localhost:4000‘.
Warning:The preview site is temporary, you must connect it to the Github Pages to show in the Internet.
- Use
hexo dto upload your blog to Internet. You can use it once it’s connected with Github.
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“
Create a file like CNAME in your Github, then enter your domain name.
Also, you need to enter this name into the Settings of Github Pages.
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.
Open the generated file called id_rsa.pub, then paste it into the SSH keys of your github.
Enter the following code to check if the keys work:
ssh -T git@GitHub.com
Step 3
Congradulations! You have sucessfully created your personal blog. But how to make it more personalized?
- Select your favorite theme
Open hexo, clone your preferred theme.
Enter the name of the theme after “theme“ in the file “config.yml“.
Finally,enter the following codes to update your theme.
hexo clean hexo g hexo d