hexo主题-NexT主题食用

NexT 主题是一个非常简洁的主题,非常适合新手使用。下面我将介绍如何安装和使用 NexT 主题:

# 安装主题

  • 这一步直接在博客项目文件中执行,安装好的主题会在 ./themes/next
1
git clone https://github.com/next-theme/hexo-theme-next ./themes/next
  • 在_config.yml 中设置
1
theme: next

# NexT 的配置

打开 ./themes/next/_config.yml

搜索 menu 可配置菜单,将需要的菜单注释去掉,并添加菜单项,如:

1
2
3
4
5
6
7
8
9
menu:
home: / || fa fa-home
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
about: /about/ || fa fa-user
# commonweal: /404/ || fa fa-heartbeat

去掉之后,在浏览器依旧是看不到内容的,需要创建对应页面。

1
2
3
hexo new page "tags"
hexo new page "categories"
hexo new page "about"

并且需要在创建好的页面中添加 type 字段,如:

/tags/index.md

1
2
title: tags
type: "tags"

/categories/index.md

1
2
title: categories
type: "categories"

/about/index.md 可编辑关于页面内容。

1
2
3
4
5
6
---
title: about
type: "about"
---
<p align="center">关于我</p>