Skip to content

Hexo get started

Hexo is a fast, simple and powerful blog framework. You write posts in Markdown (or other languages) and Hexo generates static files with a beautiful theme in seconds.

Install hexo

sudo npm install -g hexo-cli
hexo -v

Create a project by hexo

hexo init ***.github.io
cd ***.github.io
npm install

Add Github Page deploy into the hexo project

Add the bellow content in the _config.yml file

deploy:
  type: git
  repo: https://github.com/***/***.github.io.git
  branch: master
  message:  #leave this blank

Add local assets support in the hexo project

Edit the bellow property to true in the _config.yml file

post_asset_folder: true
Create a folder with the same name of the md file under source/_posts folder, and put images into the folder Insert the bellow image link into the md file
![<image title>](<folder name>/***.png)

Run the hexo application

hexo serve

Create a new page

hexo new post "hello world"

Edit an existing page

cd source/_posts
# Rename or delete any file or modify the title property in it

Generate static files

hexo generate

Deploy the hexo application to GitHub Page

# Remove the .deploy_git folder if needed
hexo clean
hexo deploy