# 商业版首发，Halo 2.22 发布

原文：<https://www.halo.run/archives/halo-2.22-released>

Halo 是一款强大易用的开源建站工具，它让你无需太多的技术知识就可以快速搭建一个博客、网站或者内容管理系统。具备可插拔架构、主题套用、富文本编辑器等多重特性，支持用户根据自己的喜好选择不同类型的插件及主题模板来定制化自己的站点功能及外观。让内容创作和发布更加便捷生动。

截至目前（2025 年 Q4 季度），Halo 已经在 Docker Hub 获得了超过 280 万次下载，GitHub Star 数突破 37 k，并拥有一百多名社区贡献者。

2025 年 12 月 24 日，强大易用的开源建站工具 Halo 正式发布 2.22 版本。

[https://www.bilibili.com/video/BV17avYB5E2V](https://www.bilibili.com/video/BV17avYB5E2V)

## ⚠️ 重要提示

1.  此版本重构了部分插件 API，升级之后可能导致部分插件无法正常使用，升级之前建议先检查你所使用的插件是否已经兼容 Halo 2.22，在升级之后建议及时更新所有能够更新的插件。
    
2.  此版本重构了附件缩略图的生成逻辑，并且与之前版本的存储目录结构不同，所以在升级之后可能需要按需重新生成，在这个阶段可能会导致网站资源占用较高，属于正常现象。
    

## 亮点更新

### 商城功能

随着 Halo 2.22 的发布，我们同时上线了 Halo 商业版，Halo 商业版在 Halo 专业版的基础上增加了商城功能模块。支持用户基于 Halo 站点创建店铺，上架多种类型的货品与商品支付、商品发货方式。为实体商品、虚拟商品、链接商品等销售场景提供完备的电商解决方案。

[点击了解更多](https://www.lxware.cn/archives/haloshop)

![](https://www.halo.run/upload/posts/EqcvMSlHBJLVhKmFktsPZzYHRHBtGjDm.png)

![](https://www.halo.run/upload/posts/ZfSpHYdtfzcwMPmZeAAWkOpKvfbnfLJB.png)

![](https://www.halo.run/upload/posts/DcaJximJrBJKvTavTfsIINbjFUKImEKi.png)

![](https://www.halo.run/upload/posts/mzmZtHXyplGmhwwshhBBudVbAdtHAXxo.png)

![](https://www.halo.run/upload/posts/OdFvkTsdonunURjKfNFEbXYfAFIzcBRn.png)

![](https://www.halo.run/upload/posts/biAQJSgnIHKQprCNqASknfkJjKOfbRxG.png)

![](https://www.halo.run/upload/posts/LWMdyYJrZWTkgiOIbdJhZxLAaliUxgKV.png)

![](https://www.halo.run/upload/posts/wZaZcjjOahIbkJWEXpMLjCCZAbxcJCQt.png)

![](https://www.halo.run/upload/posts/JCpxCCfZBYGTevoVqogecmtZPjoYeqgp.png)

### 编辑器更新

#### 图片集

在 Halo 2.22 中，我们在编辑器中新增了图片集的功能，可以同时添加多张图片排列在一起。

![](https://www.halo.run/upload/posts/gCQCHrKscsPvauZGqodbMYeoBYiMqVVz.png)

![](https://www.halo.run/upload/posts/OuARvwoQbaBfzlObTtnDmhuaSPlKzkly.png)

#### 图片支持描述文本

在 Halo 2.22 中，我们为编辑器图片、视频、音频添加了描述文本的支持。

![](https://www.halo.run/upload/posts/QbpIGsfYqvjfnwFwoMtBWqlPBoPBPedn.png)

![](https://www.halo.run/upload/posts/FHhqrhkjnIHvTDezWvyWKsvShfMNdfFv.png)

#### 支持设置封面图

在 Halo 2.22 中，我们在文章编辑器中添加了设置封面的功能，进一步简化了文章编辑流程。

![](https://www.halo.run/upload/posts/iJQwcjZRvVPbyAYVmYnRQaZXiRWdbZbB.png)

![](https://www.halo.run/upload/posts/pRnrZqBzXlAGwVOHtrsyRqGRyUqhVRWi.png)

### 设置表单优化

#### 新的数组表单类型

在之前的版本中，我们为了让插件和主题的设置功能有更加灵活的数据定义能力，引入了名为 `Repeater` 的表单类型，这个表单类型可以让开发者自定义数组对象的字段，但后面观察到各个主题和插件的真实使用场景，发现这个表单类型在复杂的数据结构下很容易造成可读性问题，所以在这个版本中我们引入了一个新的数组表单类型，名为 `Array` ，此类型会默认隐藏所有设置表单，仅显示数据摘要列表，可以很大程度解决可读性问题，提高用户的配置效率。

![](https://www.halo.run/upload/posts/pUULETavmKhVWeMnAkWrJTjltsUkUvgZ.png)

旧版本 Repeater

![](https://www.halo.run/upload/posts/KwMyIbAOZSOdbMpyLVooKNVMuigiVxcr.png)

新版本 Array

![](https://www.halo.run/upload/posts/bYxeCtmFOFcoyiQxVhUicmnRrUYmCVCl.png)

新版本 Array

#### 附件类型支持预览和上传

在之前的版本中，附件类型的表单项仅支持输入链接或者从附件库选择附件，在 Halo 2.22 中，我们彻底重构了附件表单类型，支持了附件预览和直接上传。

![](https://www.halo.run/upload/posts/yQckqpMYrhdfkfEgxEXqLeTJgobylOLl.png)

![](https://www.halo.run/upload/posts/cPweaMFbBgsYhXPLZzWyKkEOqQykatWX.png)

#### 图标选择

在 Halo 2.22 中，我们引入了一个全新的图标表单类型，集成了 [Iconify](https://iconify.design/)，可以直接从 Iconify 平台选择图标，此平台汇集了主流的开源图标库，总计约 20 万图标，能够满足绝大部分需求。

![](https://www.halo.run/upload/posts/VRKioAZOUJwGWwNyFKQEoOppbVZdaKlb.png)

> 需要注意的是，这个功能需要主题和插件主动适配。

### 附件管理

#### 存储策略支持排序和隐藏

在 Halo 2.22 中，我们为附件存储策略添加了隐藏和排序的设置项，我们可以将不常用或者不会主动上传的附件存储策略进行隐藏或者调整顺序。

![](https://www.halo.run/upload/posts/atsxLRbTJBcquhtfWJvnEBUnlutfqrle.png)

![](https://www.halo.run/upload/posts/FWsbyJOqgHZrsxsafownLBObfcGkBOTV.png)

#### 优化附件选择弹窗

在 Halo 2.22 中，我们优化了附件选择弹窗的操作逻辑，现在支持直接在选择界面调出上传界面，并复用选择界面所选的存储策略和分组，可以很大程度的减少操作流程。

![](https://www.halo.run/upload/posts/TnmzLzqDwiaynklPkLPYtiVdhGeRVwZi.png)

### 性能优化

#### 附件缩略图重构

在 Halo 2.22 中，我们重构了附件缩略图的生成逻辑，现在无需在数据库保存缩略图的状态，可以很大程度减少数据库的操作，进而提升页面的渲染速度和减少资源消耗。除此之外，重构之后还支持按需生成，只有当缩略图被访问时才进行生成操作，这样可以避免资源浪费。

#### Console 页面优化

在 Halo 2.22 中，我们将 Console 和个人中心的部分页面改为了懒加载，这样可以提高首次访问速度，也能更好的利用缓存策略。

#### 索引机制重构

在 Halo 2.22 中，我们重构了索引机制，可以带来更快的数据库查询速度和启动时的构建速度。

## 完整更新日志

### **新特性**

-   为编辑器新增图片集功能 by [**@LIlGG**](https://github.com/LIlGG) in [#7897](https://github.com/halo-dev/halo/pull/7897)
    
-   用户注册支持设置受保护用户名 by [**@liuyiwuqing**](https://github.com/liuyiwuqing) in [#7887](https://github.com/halo-dev/halo/pull/7887)
    
-   编辑器的图片、视频、音频支持添加描述文本 by [**@LIlGG**](https://github.com/LIlGG) in [#7875](https://github.com/halo-dev/halo/pull/7875)
    
-   重构编辑器拖拽功能，并为其增加功能操作菜单 by [**@LIlGG**](https://github.com/LIlGG) in [#7861](https://github.com/halo-dev/halo/pull/7861)
    
-   编辑器支持使用中文符号、唤起建议菜单 by [**@LIlGG**](https://github.com/LIlGG) in [#7840](https://github.com/halo-dev/halo/pull/7840)
    
-   支持在文章编辑页面设置封面图 by [**@ruibaby**](https://github.com/ruibaby) in [#7809](https://github.com/halo-dev/halo/pull/7809)
    
-   支持为附件存储策略设置在上传界面的显示优先级 by [**@ruibaby**](https://github.com/ruibaby) in [#7805](https://github.com/halo-dev/halo/pull/7805)
    
-   支持在附件上传界面隐藏部分存储策略 by [**@ruibaby**](https://github.com/ruibaby) in [#7792](https://github.com/halo-dev/halo/pull/7792)
    

### **功能优化**

-   清理通知发送所残留的无用数据 by [**@JohnNiang**](https://github.com/JohnNiang) in [#8007](https://github.com/halo-dev/halo/pull/8007)
    
-   用户密码允许输入 . 和 ? by [**@xzyone**](https://github.com/xzyone) in [#8005](https://github.com/halo-dev/halo/pull/8005)
    
-   为阻塞操作添加超时时间以提升系统可靠性 by [**@JohnNiang**](https://github.com/JohnNiang) in [#8004](https://github.com/halo-dev/halo/pull/8004)
    
-   优化编辑器的整体样式和交互逻辑 by [**@ruibaby**](https://github.com/ruibaby) in [#7982](https://github.com/halo-dev/halo/pull/7982)
    
-   优化 Console 和 UC 的加载速度 by [**@ruibaby**](https://github.com/ruibaby) in [#7976](https://github.com/halo-dev/halo/pull/7976) [#7971](https://github.com/halo-dev/halo/pull/7971) [#7941](https://github.com/halo-dev/halo/pull/7941) [#7935](https://github.com/halo-dev/halo/pull/7935) [#8037](https://github.com/halo-dev/halo/pull/8037)
    
-   提升 Console 端代码输入框的渲染速度 by [**@ruibaby**](https://github.com/ruibaby) in [#7956](https://github.com/halo-dev/halo/pull/7956) [#7932](https://github.com/halo-dev/halo/pull/7932)
    
-   优化个人中心身份认证设置，将三方登录与两步认证合并到一个选项卡 by [**@ruibaby**](https://github.com/ruibaby) in [#7950](https://github.com/halo-dev/halo/pull/7950)
    
-   Console 和 UC 支持异步加载所需语言包，提升首屏加载速度 by [**@ruibaby**](https://github.com/ruibaby) in [#7931](https://github.com/halo-dev/halo/pull/7931)
    
-   懒加载 Console 和 UC 的部分路由，优化首屏渲染速度 by [**@ruibaby**](https://github.com/ruibaby) in [#7930](https://github.com/halo-dev/halo/pull/7930)
    
-   文章设置中选择作者时支持显示用户名 by [**@ruibaby**](https://github.com/ruibaby) in [#7904](https://github.com/halo-dev/halo/pull/7904)
    
-   修复离线环境下，Console 无法请求接口的问题 by [**@ruibaby**](https://github.com/ruibaby) in [#7848](https://github.com/halo-dev/halo/pull/7848)
    
-   解决生成缩略图时可能出现内存溢出的问题 by [**@JohnNiang**](https://github.com/JohnNiang) in [#7817](https://github.com/halo-dev/halo/pull/7817)
    
-   支持配置缩略图生成启用、禁用和并发量 by [**@JohnNiang**](https://github.com/JohnNiang) in [#7812](https://github.com/halo-dev/halo/pull/7812)
    
-   为编辑器的命令面板添加插入图片的选项 by [**@ruibaby**](https://github.com/ruibaby) in [#7803](https://github.com/halo-dev/halo/pull/7803)
    
-   重构图片缩略图功能，移除缩略图记录，改为按需生成 by [**@JohnNiang**](https://github.com/JohnNiang) in [#7779](https://github.com/halo-dev/halo/pull/7779)
    
-   新增 Shiki 代码高亮和超链接卡片预设插件 by [**@ruibaby**](https://github.com/ruibaby) in [#7785](https://github.com/halo-dev/halo/pull/7785)
    
-   优化系统性能 by [**@JohnNiang**](https://github.com/JohnNiang) in [#8045](https://github.com/halo-dev/halo/pull/8045)
    
-   优化文章详情页面加载 by [**@JohnNiang**](https://github.com/JohnNiang) in [#8047](https://github.com/halo-dev/halo/pull/8047)
    
-   优化编辑器搜索界面的样式 by [**@ruibaby**](https://github.com/ruibaby) in [#8052](https://github.com/halo-dev/halo/pull/8052)
    
-   重构附件选择弹窗，与上传界面融合 by [**@ruibaby**](https://github.com/ruibaby) in [#8058](https://github.com/halo-dev/halo/pull/8058)
    
-   重构附件表单类型，支持预览和直接上传 by [**@ruibaby**](https://github.com/ruibaby) in [#8061](https://github.com/halo-dev/halo/pull/8061)
    
-   重构附件默认存储策略配置，统一在设置 -> 附件设置中配置 by [**@JohnNiang**](https://github.com/JohnNiang) in [#8092](https://github.com/halo-dev/halo/pull/8092)
    

### **问题修复**

-   解决无法在编辑器中插入视频的问题 by [**@LIlGG**](https://github.com/LIlGG) in [#7986](https://github.com/halo-dev/halo/pull/7986)
    
-   修复可能无法初始化主题配置的问题 by [**@JohnNiang**](https://github.com/JohnNiang) in [#7923](https://github.com/halo-dev/halo/pull/7923)
    
-   修复潜在的内存泄漏问题 by [**@JohnNiang**](https://github.com/JohnNiang) in [#7914](https://github.com/halo-dev/halo/pull/7914)
    
-   优化重置密码时因邮箱可输入大小写导致的问题 by [**@JohnNiang**](https://github.com/JohnNiang) in [#7901](https://github.com/halo-dev/halo/pull/7901)
    
-   解决切换代码块语言时编辑器页面不正常跳动的问题 by [**@LIlGG**](https://github.com/LIlGG) in [#7839](https://github.com/halo-dev/halo/pull/7839)
    
-   修复可能无法正常获取附件链接的问题 by [**@JohnNiang**](https://github.com/JohnNiang) in [#7788](https://github.com/halo-dev/halo/pull/7788)
    

### **依赖更新**

-   升级 Spring Boot 至 3.5.7 by [**@JohnNiang**](https://github.com/JohnNiang) in [#7871](https://github.com/halo-dev/halo/pull/7871)
    
-   升级 Spring Boot 至 3.5.9 by [**@JohnNiang**](https://github.com/JohnNiang) in [#8069](https://github.com/halo-dev/halo/pull/8069)
    
-   升级 Tiptap 至 3.x by [**@LIlGG**](https://github.com/LIlGG) in [#7811](https://github.com/halo-dev/halo/pull/7811)
    

### **开发者相关**

-   修复 `@halo-dev/components` 的 Dropdown 组件类型问题 by [**@ruibaby**](https://github.com/ruibaby) in [#7974](https://github.com/halo-dev/halo/pull/7974)
    
-   将 `@halo-dev/console-shared` 重命名为 `@halo-dev/ui-shared` by [**@ruibaby**](https://github.com/ruibaby) in [#7926](https://github.com/halo-dev/halo/pull/7926)
    
-   `@halo-dev/console-shared` 包提供 `utils.id.uuid()` 方法，用于生成 uuid by [**@ruibaby**](https://github.com/ruibaby) in [#7898](https://github.com/halo-dev/halo/pull/7898)
    
-   在 `@halo-dev/console-shared` 包中提供 `stores` 对象，包含 currentUser 和 globalInfo by [**@ruibaby**](https://github.com/ruibaby) in [#7858](https://github.com/halo-dev/halo/pull/7858)
    
-   支持在插件的 UI 中使用 Pinia 定义全局 Store by [**@ruibaby**](https://github.com/ruibaby) in [#7858](https://github.com/halo-dev/halo/pull/7858)
    
-   在 `@halo-dev/console-shared` 包中提供 UI 权限检查工具 by [**@ruibaby**](https://github.com/ruibaby) in [#7853](https://github.com/halo-dev/halo/pull/7853)
    
-   在 `@halo-dev/console-shared` 包中提供统一的 date 和 attachment 工具 by [**@ruibaby**](https://github.com/ruibaby) in [#7847](https://github.com/halo-dev/halo/pull/7847)
    
-   优化索引引擎以提升索引和查询性能 by [**@JohnNiang**](https://github.com/JohnNiang) in [#7822](https://github.com/halo-dev/halo/pull/7822)
    
-   优化 FormKit 的 color 输入类型，支持透明度 by [**@ruibaby**](https://github.com/ruibaby) in [#8003](https://github.com/halo-dev/halo/pull/8003)
    
-   为 FormKit 添加 Iconify 选择组件 by [**@ruibaby**](https://github.com/ruibaby) in [#8000](https://github.com/halo-dev/halo/pull/8000)
    
-   重构 `@halo-dev/components` 中的 Dropdown 组件，改为完全使用 `floating-vue` 的原始组件 by [**@ruibaby**](https://github.com/ruibaby) in [#7978](https://github.com/halo-dev/halo/pull/7978)
    
-   改进 `@halo-dev/api-client` 包的配置，在外部使用的时候支持 tree shaking by [**@ruibaby**](https://github.com/ruibaby) in [#7966](https://github.com/halo-dev/halo/pull/7966)
    
-   FormKit Color 支持 hsl 格式，并支持手动编辑色值 by [**@ruibaby**](https://github.com/ruibaby) in [#8039](https://github.com/halo-dev/halo/pull/8039)
    
-   为文章、页面等元数据表单注入当前表单的数据，以便在元数据定义中判断是否需要显示表单项 by [**@ruibaby**](https://github.com/ruibaby) in [#8040](https://github.com/halo-dev/halo/pull/8040)
