Building a Gitpages using Hexo, we can get it done from 2 main parts separately.
1. Github setting-1st part
Visit Github, and create a new repository on the website
Input (username).github.io
as your new repository name
for example, if your username is banana, then banana.github.io is your new repository name
Use CMD to enter root directory, and use below to create a new repository
1 | git init |
Continue using CMD to push the existed repository to Github
1 | //push an existing repository |
2. Hexo setting-2nd part
Install node.js : Download node.js from its official website.
Install git: Download git from its official website.
Install Hexo: Input below in CMD
1 | npm install -g hexo-cli |
After you finish all of the above steps, use CMD to enter the place you want to store your page data
Create necessary file in your designated folder
1 | hexo init <folder name> |
Input as below in CMD, and activate your page on local server
1 | hexo s |
Now we can add new articles, and learn how to use Markdown tool to edit your article
1 | hexo new post "article name" //add new article |
Go to source folder, you can find the new post you just added, and change title,date, tages as your preference
1 | title: 'Tutorial of building Gitpage with Hexo in 10 minutes' // title of the article |
Make some adjustment in your _config.yml
under root directory
1 | deploy: |
After finishing new article, use below to generate new public folder
1 | hexo g |
Publish to your Gitpage
1 | hexo c //Wipe out your existed public file |
Additional Knowledge
Using Google Drive as the source to attach photos on Gitpage
Upload photo to Google drive, and adjust sharing setting as below
Get Image_ID
Input Image_ID as below
1 | ![](https://drive.google.com/uc?export=view&id=[Image_ID]) |