快速开始
安装
安装 Hexo 与 Solitude 主题,并准备主题配置文件。
准备环境
先安装 Node.js,并确认包管理器可用。Hexo 和 Solitude 都运行在 Hexo 博客目录中,因此需要先创建或进入你的博客项目。
安装 Hexo CLI
npm install -g hexo-cli
hexo init my-blog
cd my-blog
npm install安装主题
任选一种安装方式。NPM 更便于升级;Git 更适合需要查看或定制主题源码的场景。
npm install hexo-theme-solitudegit clone https://github.com/everfu/hexo-theme-solitude.git themes/solitude启用主题
在 Hexo 根配置中设置主题名称。
# _config.yml
theme: solitude准备主题配置
把主题配置复制到博客根目录,后续本地改动都写在这里。
cp node_modules/hexo-theme-solitude/_config.yml _config.solitude.yml如果使用 Git 安装,则从主题目录复制:
cp themes/solitude/_config.yml _config.solitude.yml预期结构
博客目录
_config.yml
_config.solitude.yml
source
themes
建议把自定义主题配置保存在博客根目录。这样升级主题时,本地配置不会和包内文件混在一起。