hexo-theme-diversity
v2.3.10
Published
Hexo Theme Diversity
Readme
Diversity

博客多样性,一款多主题自由切换的Hexo主题
安装
1. 接入Diversity主题
在你的 Hexo 项目根目录,执行以下命令,并将 _config.yml 中的 theme 修改为 diversity。
git clone --depth 1 https://github.com/huazie/hexo-theme-diversity themes/diversity_config.yml
- theme: other-theme
+ theme: diversity同步 Diversity 主题配置和资源
你可以采用如下三种方式:
- 手动同步【不推荐】
将 themes/diversity 目录下的 _config.diversity.yml,添加到你的 Hexo 项目根目录。
将 themes/diversity 目录下的 other 目录中的目录和文件复制或移动到你的 Hexo 项目根目录。
- 执行
hexo server命令后同步_config.diversity.yml配置和other目录内容。【推荐】
# 本地预览时同步【非强制覆盖】
hexo s
# 使用强制覆盖模式
hexo s --force // 本地预览时强制覆盖已存在文件
hexo s -f // 本地预览时强制覆盖已存在文件(参数简写)- 执行
hexo dsync命令专门同步_config.diversity.yml配置和other目录内容。【推荐】
# 本地直接同步【非强制覆盖】
hexo dsync
# 使用强制覆盖模式:
hexo dsync --force // 本地同步时强制覆盖已存在文件
hexo dsync -f // 本地同步时强制覆盖已存在文件(参数简写)当然你也可以选择通过项目依赖导入,在 Hexo 项目 package.json 文件中添加如下【x.x.x 替换为指定版本号】:
"dependencies": {
"hexo-theme-diversity": "^x.x.x"
}2. 接入其他主题
有如下两种方式【查看 _config.diversity.yml 中 themes 属性配置】:
- 将待接入主题相关的源码下载到项目根目录的
themes目录下,并各自命名,如下所示【其中diversity是上述所下载的】:
├─themes
│ ├─diversity
│ ├─light
│ ├─phase- 通过项目依赖导入,比如
landscape主题,如下:
"dependencies": {
"hexo-theme-landscape": "^1.0.0"
}添加其他主题相关配置,详细说明请查阅 docs/zh/other-config.md。
更新
执行以下命令,用以更新 Diversity。
cd themes/diversity
git pull配置
Diversity 主题配置
详细 Diversity 主题配置说明,请查阅 docs/zh/diversity-config.md。
国际化配置
详细国际化配置说明,请查阅 docs/zh/i18n-config.md。
数据文件配置
详细数据文件配置说明,请查阅 docs/zh/data-config.md。
多主题相关配置
详细多主题相关配置说明,请查阅 docs/zh/other-config.md。
文档
详细了解,请翻看 Huazie 的博客分类之 博客框架-Hexo 中的文章。
插件
以下为 Diversity 主题独立出来的 Hexo 插件,欢迎大家使用:
- hexo-hot-config - Hexo 热配置插件,支持实时更新配置
- hexo-generator-comments - Hexo 多评论系统生成插件,支持多种评论系统的集成与切换,提供统一的评论界面。
- hexo-comments-utterances - Hexo Utterances 评论插件,支持 Utterances 评论系统的集成
- hexo-comments-gitalk - Hexo Gitalk 评论插件,支持 Gitalk 评论系统的集成
- hexo-comments-giscus - Hexo Giscus 评论插件,支持 Giscus 评论系统的集成
