Start blogging with Hexo (Part 2)

Start blogging with Hexo (Part 2)
eugewx1.Abstract
Before we proceed, in the previous blog Start blogging with Hexo (Part 1) we had successfully publish to GitHub pages, but here we insist to use custom domain and deploy to Vercel.
2.Deploy to Vercel with Custom Domain
2.1 Deploy to Vercel
Intro to Vercel: Vercel builds a frontend-as-a-service product. It will ease engineers to deploy and run the user facing parts of their applications.
- First, register a Vercel account with GitHub account, so that it will be easy to host directly from GitHub repo.
- On the top right of the Vercel > Add New > Project and import
<username>.github.io projectand pressDeployto start deploying Hexo into Vercel - Wait until deploy complete and press
Continue to Dashboardand you can access Hexo blog through Domains.
2.2 Custom domain
Now our Hexo blog are using username.github.io and Vercel have one username-github.io.vercel.app. Where we can buy a custom domain and resolve it.
I had bought eugeneewe.com from Cloudflare.com
- On the Vercel dashboard, click
Domainsbutton to check what are the doamin currently have it on Vercel. - Here we will add
eugeneewe.comDomain into Vercel, it will recommend us to addwwwas well. - Follow the Vercel instructure, create
AandCNAMEdns record on Cloudflare.However there is some issue with the Cloudflare proxy, please refer to 2.3 Cloudflare and Vercel integration
- Go to
_config.ymlfile top updateurlinto new domain name - Dont forget Github page, we can custom domain as well. Back to Github, open
username.github.iorepo and findSettings > Pages > Custom Domainupdate same domain name. Here I useeugeneewe.comand clicksave
Wait until DNS resolve finish, you will be able to access Hexo project with custom name.
2.3 Cloudflare and Vercel integration
Follow the blogs to use Cloudflare proxy with Vercel
3. Install Custom Theme
安知鱼主题 modified from Butterfly theme which this is the purpose I setup Hexo blogging
- Go to
Z:\blog\hexo-blogpath install Anzhiyu theme, here I use1
git clone -b main https://github.com/anzhiyu-c/hexo-theme-anzhiyu.git themes/anzhiyu
- Apply
Anzhiyutheme
Open_config.yml1
2
3
4# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: anzhiyu - Install
pugandstylusrender module which is require byAnzhiyuto generate page1
npm install hexo-renderer-pug hexo-renderer-stylus --save
4. Override Config
- Go to
Z:\blog\hexo-blog\themes\anzhiyu\_config.ymlfile to hexo root path and renamed it to_config.anzhiyu.yml_config.anzhiyu.ymlconfig file will be priority, anything config inside_config.ymlwill no longer valid- Everytime theme update might update config file as well, please take note on the changelog and it could require manual update
_config.anzhiyu.yml
- Publish hexo to GitHub Wait for a while and you will see update on eugeneewe.com
1
hexo cl && hexo g && hexo d
5. Page Setup
Before proceed, Anzhiyu themes had a Front-matter that need to understand.
> Something like page metadata/scaffolds path had two front-matter template fo
page.mdFront-matter forwebpagepost.mdFront-matter forblog post
page.md template, for reference
1 |
|
post.md template, for reference
1 |
|
Note: Here will use [BlogRoot] to act as default Hexo Path [Z:\Blog\hexo-blog]
5.1 Setup Tag Page
- Go to Hexo root folder, use
Git Bashto execute following command1
hexo new page tags
- Under
[BlogRoot]\source\it will generate a folder namedtagsand file namedindex.md - Edit
[BlogRoot]\source\tags\index.mdlike following1
2
3
4
5---
title: tags
date: 2025-01-12 00:25:33
type: "tags"
---
5.2 Setup Categories Page
- Go to Hexo root folder, use
Git Bashto execute following command1
hexo new page categories
- Under
[BlogRoot]\source\it will generate a folder namedcategoriesand file namedindex.md - Edit
[BlogRoot]\source\tags\index.mdlike following1
2
3
4
5
6
7---
title: categories
date: 2025-01-12 01:31:08
type: "categories"
top_img: false
aside: false
---
5.3 Setup Friend Link Page
5.4 Setup About Page
5.5 Setup Equipment Page
5.6 Start your first blog
1 | hexo new "<title>" |
5.7 Create new page tag
1 | hexo new page "<tag>" |
6. Blog post pinned module
It will help user to pin the blog post as priority
Install module
1 | npm install hexo-generator-topindex --save |
Pinned Blog Post
To pinned blog post add the top attribute like following
1 |
|
7. Extra Module
7.1 Local Search
It will help user to search through Hexo
Install module
1 | npm install hexo-generator-search --save |
_config.anzhiyu.yml
1 | local_search: |
7.2 Word Count
Word count for the post
Install module
1 | npm install hexo-wordcount --save |
_config.anzhiyu.yml
1 | wordcount: |
8. To-Do List
- Hexo Caching with ServiceWork 小白也能用的 SW 构建插件










