更新于 

安装Stellar主题

安装 Stellar 主题

Stellar 是一款功能丰富、设计精美的 Hexo 主题,支持文档、博客、Wiki 等多种场景。

安装方式

方式一:npm 安装(推荐)

1
npm install hexo-theme-stellar

_config.yml 中启用:

1
theme: stellar

方式二:Git 安装

1
2
cd themes
git clone https://github.com/xaoxuu/hexo-theme-stellar stellar

_config.yml 中启用:

1
theme: stellar

创建主题配置文件

Stellar 主题使用独立的配置文件 _config.stellar.yml(放在博客根目录,与 _config.yml 同级)。

1
touch _config.stellar.yml

基本配置

编辑 _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
26
######## Sidebar ########
sidebar:
logo:
avatar: '[/images/avatar.png](/about/)'
title: '[你的博客名](/)'
subtitle: '记录生活与技术'
menu:
post: '[文章](/)'
wiki: '[文档](/wiki/)'
about: '[关于](/about/)'
widgets:
home: search, welcome, recent
post: search, toc
wiki: search, toc, related
page: toc, search, welcome

######## Article ########
article:
auto_excerpt: 200
license: '本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。'
share: [wechat, weibo, email, link]

######## Footer ########
footer:
content: |
使用 [Hexo](https://hexo.io/) + [Stellar](https://github.com/xaoxuu/hexo-theme-stellar) 主题创建

必装插件

Stellar 主题依赖以下插件,建议安装:

1
npm install hexo-related-popular-posts

配置搜索

确保 _config.yml 中有搜索配置:

1
2
3
4
search:
path: search.json
field: all
content: true

安装搜索插件:

1
npm install hexo-generator-search

验证主题

启动本地服务器查看效果:

1
2
hexo clean
hexo server

访问 http://localhost:4000 查看主题效果。


💡 提示:Stellar 主题的完整配置请参考 官方文档


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

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