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 -gto install hexomkdirdirectoryto create a new directory for a new Hexo projectcddirectoryto enter the new directoryhexo initto initialize a new Hexo projecthexo serverto start a server on a local host (hexo s for short)hexo newpost_nameto create a new post (hexo n for short)hexo cleanto clean the static fileshexo generateto generate new static filesnpm install hexo-deployer-git --saveto install the git deployer
create a new repository on GitHub, the name must be
githubusername.github.ioin 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 deployin 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