Build Personal Blog -- Github Page + Hexo Installation
Installation Process (MacOS)
Create a new repository on Github named
{yourname}.github.io
. The{yourname}
must be the same as your Github username.Install hexo (node and git need to be installed previously)
npm install -g hexo-cli
Create local blog folder
hexo init myBlog
cd myBlog
npm install
Install hexo developer git
npm install hexo-deployer-git --save
Create new blog
hexo new "My New Post"
Start local server
hexo s
So far you can open the browser and go to localhost:4000, then you will see the Hello World page
Add github push configuration to hexo
_config.yml
(there is space between key and value, BE CAREFUL)1
2
3
4deploy:
type: git
repo: https://github.com/{yourname}/{yourname}.github.io.git
branch: masterClean the
public
folder to avoid cachehexo clean
Push to github (
g
stands for generate the needed files inpublic
folder)hexo g -d
Go to
{yourname}.github.io
and you will see the succeful online page
- Post link: https://leisurelyfool.com/posts/11353.html
- Copyright Notice: All articles in this blog are licensed under BY-NC-SA unless stating additionally.