Hexo主题-Next

1 主题安装

选用npm管理包的方式

到项目根目录下

1
sudo npm install hexo-theme-next

将来更新主题sudo npm install hexo-theme-next@latest

2 启用主题

修改hexo的配置文件根目录/_config.yml

1
2
3
4
# 主题
# fluid
# next
theme: next

本地运行站点看下效果

1
2
hexo clean
hexo s

3 主题配置

下面便是针对主题进行配置

  • 先到github上把配置文件复制出来

  • 托管到自己的github上,统一管理工具链配置

执行如下脚本便可以在博客根目录下建立软链接根目录/_config.next.yml

1
2
cd /Users/dingrui/MyDev/env/os_script
./configure.sh

之后便在根目录/_config.next.yml中根据自己的需求进行配置即可

3.1 菜单设置

1
2
3
4
5
6
7
8
9
menu:
home: /home/ || fa fa-home
tags: /tags/ || fa fa-tags
categories: /categories/ || fa fa-th
archives: /archives/ || fa fa-archive
about: /about/ || fa fa-user
#schedule: /schedule/ || fa fa-calendar
#sitemap: /sitemap.xml || fa fa-sitemap
#commonweal: /404/ || fa fa-heartbeat

将来通过hexo generate生成静态页面的时候会在public目录下生成对应的index.html,在source目录下默认是没有这几个页面的

  • /source/home/index.md

  • /source/home/tags.md

  • /source/home/categories.md

  • /source/home/about.md

因此要自己新建对应的页面

  • 1 home

    • 新建

      1
      hexo new page home
    • 内容

      1
      2
      3
      4
      5
      ---
      title: home
      date: 2024-03-03 15:05:49
      type: home
      ---
  • 2 tags

    • 新建

      1
      hexo new page tags
    • 内容

      1
      2
      3
      4
      5
      ---
      title: 标签
      date: 2024-03-03 14:59:32
      type: tags
      ---
  • 3 categories

  • 新建

    1
    hexo new page categories
  • 内容

    1
    2
    3
    4
    5
    ---
    title: 类别
    date: 2024-03-03 14:59:43
    type: categories
    ---
  • 4 about

    • 新建

      1
      hexo new page about
    • 内容

      1
      2
      3
      4
      5
      ---
      title: about
      date: 2023-02-27 22:43:06
      layout: about
      ---

Hexo主题-Next
https://bannirui.github.io/2024/03/03/Hexo/Hexo主题-Next/
作者
dingrui
发布于
2024年3月3日
许可协议