mirror of https://github.com/halo-dev/halo
![]() #### What type of PR is this? /kind feature /milestone 2.2.x /kind api-change #### What this PR does / why we need it: 主题支持 requires 版本验证 - 主题安装和更新时会校验 requires,如果不通过则抛出异常。 - 主题重载或者 halo 升级后导致主题 requires 不满足条件,则会在 status 中将 phase 标记为 failed ⚠️ 特别说明: - 由于之前主题的 require 字段沿用了 1.x 版本,并没有发现与插件的 requires 属性命名不相同,因此添加了一个 requires 属性,并将 require 标记为过时,后续移除它,这个改动不算是破坏性,但如果主题需要版本校验则需要更改 theme.yaml 为 requires - 校验后如果有错误则 console 端应该提示主题升级,这样可以避免用户不知情导致很长时间主题端模板都渲染错误问题。可以通过判断 status.phase 是否为 FAILED 来展示 conditions 的第一个 item 的信息。 - 例如 halo 升级后 requires 不满足条件这种情况,并且这个主题被启用,也不会去取消激活(requires 不满足条件不会导致主题无法激活)。 **Console 需要做适配** 综上,console 应该需要: - 修改 `Halo 版本要求` 的字段取值,从 *require* -> *requires* - 提供错误信息展示,让用户知道主题不适配应该升级等错误。 #### Which issue(s) this PR fixes: Fixes #3088 #### Special notes for your reviewer: how to test it? - 测试安装、升级在 requires 满足条件和不满足时的状况是否符合描述中所述情况。 - 主题重载时加载了一个新的 requires 值触发不满足系统要求条件会在 status 中有错误信息,但不影响主题激活 /cc @halo-dev/sig-halo #### Does this PR introduce a user-facing change? ```release-note 主题支持 requires 版本验证,原 Halo 版本要求属性从 require 更名为 requires ``` |
||
---|---|---|
.github | ||
config/checkstyle | ||
docs | ||
gradle/wrapper | ||
hack | ||
src | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
Dockerfile | ||
LICENSE | ||
OWNERS | ||
README.md | ||
SECURITY.md | ||
build.gradle | ||
gradle.properties | ||
gradlew | ||
gradlew.bat | ||
settings.gradle |
README.md
Halo [ˈheɪloʊ],好用又强大的开源建站工具。
快速开始
docker run \
-it -d \
--name halo \
-p 8090:8090 \
-v ~/.halo2:/root/.halo2 \
halohub/halo:2.1 \
--halo.external-url=http://localhost:8090/ \
--halo.security.initializer.superadminuser=admin \
--halo.security.initializer.superadminpassword=P@88w0rd
以上仅作为体验使用,详细部署文档请查阅:https://docs.halo.run/getting-started/install/docker-compose
在线体验
- 环境地址:https://demo.halo.run
- 后台地址:https://demo.halo.run/console
- 用户名:
demo
- 密码:
P@ssw0rd123..
生态
可访问 awesome-halo 查看已经适用于 Halo 2.0 的主题和插件,以及适用于 Halo 1.x 的相关仓库。
许可证
Halo 使用 GPL-v3.0 协议开源,请遵守开源协议。
贡献
参考 CONTRIBUTING。