Hexo+Next(6)修改主页

因为hexo+next默认的主页是历史博客的摘要,并不是整个博客的一个总览或者介绍。

想要修改主页内容,需要进行自定义配置。

新建首页

在根目录的source文件夹下新建index.md文档。

1
2
3
4
5
6
7
8
9
10
11
12
13
source
├─404
├─aboutme
├─categories
├─home
├─images
├─tags
├─_posts
│ ├─hexo
│ ├─linux
│ ├─nginx
│ └─prometheus
└─index.md

写入front-matter。

1
2
3
4
---
title: 小站博客
date: 2023-06-21 17:31:09
---

配置首页

修改_config.yml文件,把index_generator.path的值修改成其他的值。

1
2
3
4
index_generator:
path: '/list/'
per_page: 10
order_by: -date

这样只有在使用localhost:4000/list这个url的时候,才会出现原来的摘要列表的页面。

而我们如果直接使用localhost:4000,则会进入我们新配置的主页。