Setting up a personal blog using the Hexo framework and deploying it to GitHub Pages (though I’ve changed many things over time, this guide may not be entirely relevant anymore).

Deployment

Set up your local environment with Node.js and git. You’ll need npm and git commands for the setup.

Install hexo-cli

npm install hexo-cli -g

Create a New Folder

Create a folder locally to store your blog.

mkdir blog

mkdir dull

Initialize a new website. If no path is specified, Hexo will create the site in the current directory.

hexo init

hexo init

Local Testing

hexo server

The site will start at http://localhost:4000

Create a New Post

hexo new "New Post Title"

Edit the newly created New Post Title.md file locally as needed.

Deploy to GitHub

Now deployed to Vercel, but GitHub instructions remain for reference.

This step requires a personal GitHub repository. Please create one.

Install Plugin hexo-deployer-git

npm install hexo-deployer-git --save 

Edit _config.yml

deploy: 
    type: git
    repo: https://github.com/username/username.github.io.git
    branch: main

Deployment Command

hexo deploy

Before finishing, you’ll need to enter your GitHub username and password, or authenticate directly in the browser.

Domain Name Setup

Domain Name Setup
Register a domain and complete the necessary administrative procedures.

In the domain provider’s control panel, configure DNS settings by adding two CNAME records. Set the host to www and @ respectively to ensure both www.example.com and example.com resolve to username.github.io.

In your GitHub repository’s settings, find the “Custom domain” option, add your domain, and save.

Wait a moment, and your blog should be accessible via your custom domain.

Changing Themes

You can browse and select themes from theHexo Themebased on your preferences.

Currently UsingApollo

Activate Apollo Theme

After downloading, extract it into the themes directory and rename the folder to apollo.

(Switched to Apollo) Install Nexmoe Theme

Install with npm

npm i hexo-theme-nexmoe

Clone via git

git clone https://github.com/nexmoe/hexo-theme-nexmoe.git themes/nexmoe

Install Plugin hexo-wordcount

npm i hexo-wordcount --save

This plugin is needed to support word count and reading time statistics.

Activate Nexmoe Theme

In _config.yml, change the theme value to nexmoe.

In _config.yml, change the theme value to fluid.

Fluid Configuration Options Below

Configure pretty_urls

trailing_index

Whether to keep index.html at the end of the permalink. Set to false to remove it.

trailing_html

Whether to keep .html at the end of the permalink. Set to false to remove it.

Track Page Views

Enable LeanCloud Statistics

Create a Statistics App

Get AppID and AppKey

Edit _config.yml

Enable Web Access Statistics

Import AppID and AppKey

Display PV and UV Statistics on Your Site

Enable Post View Counts