Hexo Next Theme Configuration

Overview

The blog I just built using Hexo is still pretty rough. There are lot features came with the next theme that can be enabled with one line of code to make this blog more robust. I will go over details about menu settings, social media link settings, footer settings, etc.

Basic configuration

Open _config.uml file under blog/themes/next/_config.yml. Uncomment the setting under menu section to enable features such as home, tags, about, etc.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Usage: `Key: /link/ || icon`
# Key is the name of menu item. If the translation for this item is available, the translated text will be loaded, otherwise the Key name will be used. Key is case-sensitive.
# Value before `||` delimiter is the target link, value after `||` delimiter is the name of Font Awesome icon.
# External url should start with http:// or https://
menu:
home: / || fa fa-home
about: /about/ || fa fa-user
tags: /tags/ || fa fa-tags
categories: /categories/ || fa fa-th
archives: /archives/ || fa fa-archive
#schedule: /schedule/ || fa fa-calendar
sitemap: /sitemap.xml || fa fa-sitemap
#commonweal: /404/ || fa fa-heartbeat

# Enable / Disable menu icons / item badges.
menu_settings:
icons: true
badges: false

Create the according blog pages using hexo.

1
2
3
4
$ cd blog
$ hexo new page categories
$ hexo new page tags
$ hexo new page about

Add Tags

Open blog/source/tags/index.md file, by default it looks like below:

1
2
3
4
---
title: tags
date: 2022-07-20 00:05:23
---

Add type: tags so it looks like:

1
2
3
4
5
---
title: tags
date: 2022-07-20 00:05:23
type: tags
---

Go to a post article that want to add tags for, add a single tag: test or add multiple tags tag: [test1, test2].
Alt

Go to Tags Page on the menu, the tags show up successfully.
Alt

Add Categories

Very similar to tags, add type: categories to blog/source/categories/index.md file so it looks like:

1
2
3
4
5
---
title: categories
date: 2022-07-20 00:05:15
type: categories
---

Go to a post article header section and add categories: Hexo, now you have category set up as well.
Alt

Enable Article reads and total visits