前言

最近发现了Solitude 主题,觉得很好看,功能很多啊,很有“Live”感觉!

所以在捣鼓Solitude ——

于是就有一下问题了。

PS:我使用的部署方法是把源代码部署到仓库,再通过 .github/workflows/deploy.yml

自动化部署到 github pages

问题

我把所有都搞好后,激动的心颤抖的手部署到Github,打开一看,好嘛!

可白了!白的什么的看不见。

为什么会出现这种问题呢?

思考

现在回想起来,可能是我在source/css下新建了个index.css,

导致把原有的样式覆盖了,就有了以下解决方式

解决

一:在_config.solitude.yml文件下的 extends 引入你的自定义css,注意名字不能为index.css

二:在你的 .github/workflows/deploy.yml下如图所示的位置添加

1
2
3
4
5
6
7
8
9
- name: Install full
run: |
yarn install
yarn add hexo-renderer-ejs hexo-renderer-stylus hexo-renderer-marked --save

- name: Install Theme
run: |
git clone -b main https://github.com/everfu/hexo-theme-solitude.git themes/solitude
yarn add hexo-theme-solitude --save

这两行代表自动化部署时候重新安装插件和主题。

这样子问题就可以解决了,但注意你的代码修改配置不能在 themes/主题名/_config.yml下修改

因为重新安装主题会全部初始化。