安装主题

在根目录执行如下命令:

1
npm i hexo-theme-stellar

主导航栏

根目录下的 _config.stellar.yml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 侧边栏主功能导航菜单
menubar:
columns: 4 # 一行多少个
items: # 可按照自己需求增加,符合以下格式即可
# - id: post # 页面中高亮的 menu_id
# theme: '#1BCDFC' # 高亮时的颜色,仅 svg 中 fill="currentColor" 时有效
# icon: solar:documents-bold-duotone # 支持 svg/img 标签,可以定义在 icons.yml 文件中,也支持外部图片的 URL
# title: 博客 # 标题
# url: / # 跳转链接,支持相对路径和绝对路径
# - id: wiki
# theme: '#3DC550'
# icon: solar:notebook-bookmark-bold-duotone
# title: 文档
# url: /wiki/
# - id: explore
# theme: '#FA6400'
# icon: solar:planet-bold-duotone
# title: 探索
# url: /explore/
# - id: social
# theme: '#F44336'
# icon: solar:chat-square-like-bold-duotone
# title: 社交
# url: /friends/

文章模版

根目录下 scaffolds 文件夹中编辑 post.md

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
---
# 基本信息
title: {{ title }}
date: {{ date }}
tags: []
categories: []
description: # excerpt 也可
# 封面
cover:
banner:
poster: # 海报(可选,全图封面卡片)
topic: 标题上方的小字 # 可选
headline: 大标题 # 必选
caption: 标题下方的小字 # 可选
color: 标题颜色 # 可选
# 插件
sticky: # 数字越大越靠前
mermaid:
katex:
mathjax:
# 可选
topic: # 专栏 id
author:
references:
comments: # 设置 false 禁止评论
indexing: # 设置 false 避免被搜索
breadcrumb: # 设置 false 隐藏面包屑导航
leftbar:
rightbar:
h1: # 设置为 '' 隐藏标题
type: # tech/story
---

文档系统(wiki)

source 目录结构如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
   .
+ ├── _data
+ │   ├── wiki
+ │   │   └── hexo-cpp.yml
+ │   └── wiki.yml
├── _posts
│   ├── hello-hexo.md
│   ├── hello-stellar.md
│   └── hello-world.md
├── about
│   └── index.md
+ └── wiki
+ └── cpp
+ ├── backup.md
+ └── index.md
  • hexo-cpp.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
name: C++
title: 学习指南
subtitle: '从入门到再次入门'
tags: 博客主题
icon: https://res.xaox.cc/gh/cdn-x/wiki@main/stellar/icon.svg
cover: https://res.xaox.cc/gh/cdn-x/wiki@main/stellar/icon.svg
description: 这是一份从入门到再次入门的学习指南。
search:
filter: /wiki/cpp/
placeholder: Stellar 中搜索...
leftbar:
- tree
- timeline_cpp_releases
- related
base_dir: /wiki/cpp/
tree:
'快速开始':
- index
'网站备份':
- backup
  • wiki.yml
1
- hexo-cpp
  • index.md
1
2
3
4
---
wiki: hexo-cpp # 这是项目id,对应 /data/wiki/hexo-cpp.yml
title: c++
---