更新于 

主题配置

主题配置

_config.stellar.yml 是 Stellar 主题的配置文件,控制侧边栏、样式、插件等。

侧边栏

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
sidebar:
logo:
avatar: '[/images/avatar.png](/about/)'
title: '[博客名](/)'
subtitle: '副标题'
menu:
post: '[文章](/)'
wiki: '[文档](/wiki/)'
friends: '[友链](/friends/)'
about: '[关于](/about/)'
widgets:
home: search, welcome, recent
post: search, toc
wiki: search, toc, related
page: toc, search, welcome

侧边栏组件

组件说明
search搜索框
toc文章目录
recent近期文章
welcome欢迎信息
related相关文章
ghrepoGitHub 仓库卡片
ghissuesGitHub Issues 列表
tagcloud标签云
timeline时间线

评论系统

Stellar 支持多种评论系统:

Giscus(推荐)

1
2
3
4
5
6
7
8
9
10
11
12
comments:
service: giscus
giscus:
repo: owner/repo
repoId: xxx
category: General
categoryId: xxx
mapping: pathname
reactionsEnabled: 1
inputPosition: top
theme: preferred_color_scheme
lang: zh-CN

Twikoo

1
2
3
4
5
comments:
service: twikoo
twikoo:
js: https://cdn.jsdelivr.net/npm/twikoo/dist/twikoo.all.min.js
envId: https://your-env.netlify.app/

样式配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
style:
darkmode: auto # auto / always / false
smooth_scroll: false
font-size:
root: 16px
body: 17px
code: 85%
font-family:
body: '"LXGW WenKai Screen"'
code: 'Menlo, Monaco, Consolas, monospace'
color:
common:
accent: '#438bde'
background: 'hsl(212 16 98)'
theme: '#0078d4'
link: '#438bde'

插件配置

代码块复制

1
2
3
4
5
6
plugins:
copycode:
enable: true
js: /js/plugins/copycode.js
default_text: 'Copy'
success_text: 'Copied!'

图片懒加载

1
2
3
4
5
plugins:
lazyload:
enable: true
js: https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.min.js
transition: blur

Fancybox 图片预览

1
2
3
4
5
plugins:
fancybox:
enable: true
js: https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js
css: https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css

文章配置

1
2
3
4
5
6
7
article:
auto_excerpt: 200 # 自动摘要字数
license: '本文采用 CC BY-NC-SA 4.0 许可协议'
share: [wechat, weibo, email, link]
related_posts:
enable: true
max_count: 3

底部信息

1
2
3
4
5
6
7
footer:
social:
github:
icon: '<img src="/images/github.svg"/>'
url: https://github.com/your-username
content: |
使用 [Hexo](https://hexo.io/) + [Stellar](https://github.com/xaoxuu/hexo-theme-stellar) 主题

完整配置参考

更多配置项请参考 Stellar 主题官方文档:


💡 提示:修改主题配置后,执行 hexo clean && hexo server 查看效果。


本站由 Moriefy 使用 Stellar1.22.1 主题创建
使用Hexo Github Vercel 强力驱动
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。

发表了 16 篇文章 · 总计 18.5k 字