This article would be my first tutorial on the ground.
I’m gonna introduce how to easily use Hexo to generate your personal blog.
1. Create new repository on GitHub
To begin with, this blog is built on the gitHub page, so you have to sign in
GitHub and create a new repository, which is named GitHub Account name @ github.com.
2. Instal Node.js, npm, and Hexo
For HomeBrew user:
brew install node
The npm is a node package management tool, which will be automatically installed
along with above command.
Or, you can download from its official website.
Then, type command below to install Hexo:
npm install -g hexo
3. Start blogging
- Create source folder & Init Hexo
Go to any path location and create a blog folder.
Do Hexo initiate:
hexo init
you will get whole required folders inside.
- New an article
Then, you can start creating your first article as followed:
hexo new "title of your article"
You will find a file called “title.md” under source->_posts folder
Open it with your favorite text editor and write your article
with Markdown format.
- Generate public file for deploy
Before you deploy the blog onto server, you should generate a public file with:
hexo generate
you’ll find public version under “public” folder.
- View on local server
In order to check your article first before deploy,
you can review it on localhost by:
hexo server
The default port is 4000, so just type in localhost:4000 on the browser.
- Deploy on gitHub
Before you deploy, you should modify _config.yml for configuration.
Open it and make it like this:
deploy:
type: github
repository: git@github.com:your_git_account/your_git_account.github.com.git
branch: master
Then, type below command:
hexo deploy
Congratulations!!! You’re all done.
You can view your blog site on yourName.github.io .
Enjoy blogging.