My first post using hexo framework for blog
Hi, this is Jerry (Zijie) Wu! I decided to start writing blogs. And after some quick research, I found that hexo seems to fit my needs. It can be deployed on GitHub so I don't have to rent a server. I've also considered using LinkedIn as a blog platform, but seems like not many people are doing that and it doesn't look "geeky."
I will mainly use the blog to write about things related to my major (Electrical and Computer Engineering) and hope to share my knowledge and experience with others (if anyone ever visits).
Setup Hexo
In the following, I will briefly talk about how to set up Hexo and deploy it on GitHub and how to use it.
Install
install node.js
open terminal
npm install hexo-cli -g
to install hexomkdir
directory
to create a new directory for a new Hexo projectcd
directory
to enter the new directoryhexo init
to initialize a new Hexo projecthexo server
to start a server on a local host (hexo s for short)hexo new
post_name
to create a new post (hexo n for short)hexo clean
to clean the static fileshexo generate
to generate new static filesnpm install hexo-deployer-git --save
to install the git deployer
create a new repository on GitHub, the name must be
githubusername.github.io
in the _config.yml file, and modify the deploy** section:
1
2
3
4deploy:
type: git
repo: https://oauth2:yourtoken@github.com/*****.github.io
branch: masterremember not to include yourtoken in a public repository.
run
hexo deploy
in terminal to deploy to GitHub (hexo d for short)now you can access your blog at
https://githubusername.github.io
(wait for a few minutes if it doesn't work)
Usage
hexo n "title"
: create a new posthexo s
: start a server in a local hosthexo cl
: clean the static fileshexo g
: generate the static fileshexo d
: deploy to GitHub