安装Stellar主题
安装 Stellar 主题
Stellar 是一款功能丰富、设计精美的 Hexo 主题,支持文档、博客、Wiki 等多种场景。
安装方式
方式一:npm 安装(推荐)
1 | npm install hexo-theme-stellar |
在 _config.yml 中启用:
1 | theme: stellar |
方式二:Git 安装
1 | cd themes |
在 _config.yml 中启用:
1 | theme: stellar |
创建主题配置文件
Stellar 主题使用独立的配置文件 _config.stellar.yml(放在博客根目录,与 _config.yml 同级)。
1 | touch _config.stellar.yml |
基本配置
编辑 _config.stellar.yml,添加以下基本配置:
1 | ######## Sidebar ######## |
必装插件
Stellar 主题依赖以下插件,建议安装:
1 | npm install hexo-related-popular-posts |
配置搜索
确保 _config.yml 中有搜索配置:
1 | search: |
安装搜索插件:
1 | npm install hexo-generator-search |
验证主题
启动本地服务器查看效果:
1 | hexo clean |
访问 http://localhost:4000 查看主题效果。
💡 提示:Stellar 主题的完整配置请参考 官方文档。