hexo安装next主题

安装

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

修改主题为Gemini

scheme: Gemini

1
2
3
4
5
6
7
8
9
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
1
2
3
menu_settings:
icons: true //是否显示图标
badges: true //是否显示各分类数量

启用tags和categories后,需要增加页面

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

进入source目录下新建的tags,categories目录,修改index.md,增加type

1
2
3
4
5
---
title: tags
date: 2024-02-17 14:24:00
type: tags
---

设置文章摘要

默认开启:excerpt_description: true
在文章需要截断的地方加上 <!--more-->,首页就只会显示其之上的内容。

开启搜索功能

参考:https://github.com/next-theme/hexo-generator-searchdb

安装搜索:$ npm install hexo-generator-searchdb

根目录 _config.yml 文件增加如下:

search:
  path: search.xml
  field: post
  content: true
  format: html

修改theme/next目录下的 _config.yml:

# Local Search
# Dependencies: https://github.com/next-theme/hexo-generator-searchdb
local_search:
  enable: true