# 编辑器大升级，Halo 2.2.0 发布

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

2023 年 2 月 1 日，强大易用的开源建站工具 Halo 正式发布 2.2.0 版本，共优化了 10 多项问题，带来了 20 多项功能更新和优化，感谢大家的反馈和参与。

## **主要亮点更新**

### 文章详情页面渲染速度优化

在之前版本中，我们均收到了在多次编辑文章或者包含大文本内容时文章渲染缓慢的问题反馈。在 2.2.0 中，我们已经针对这个问题进行了优化，大幅降低文章详情页面的渲染时长。

测试结果可以参考：[**halo-dev/halo#3168 (comment)**](https://github.com/halo-dev/halo/pull/3168#issuecomment-1385454691)

### 重构文章分类和标签选择器

在之前的版本中，文章的分类以及标签选择是通过复选框实现的，在数据过多的场景下，会带来难以选择的问题，并且无法新增。在 2.2.0 中，我们重新设计了其选择组件的 UI 和功能，现在可以支持：

1.  布局优化，不再以平铺的方式展示。
    
2.  关键词搜索。
    
3.  快捷键支持，可以通过方向键选择搜索结果，回车键确定选择。
    
4.  支持创建新标签或者分类。
    

![post-tag-selection.png](https://www.halo.run/upload/post-tag-selection.png)

![post-category-selection.png](https://www.halo.run/upload/post-category-selection.png)

### 系统概览页面

在 2.2.0 版本中，我们提供了系统概览页面，用于方便的查看 Halo 环境的状况。

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

### 编辑器功能优化

在 2.2.0 版本中，我们加强了默认编辑器的媒体内容编辑等功能，现在已经支持以下功能：

1.  支持拖拽和粘贴图片到编辑器并上传到附件库。
    
2.  更加方便的支持图片的位置和大小设置。
    
3.  支持插入视频和音频。
    
4.  支持为选中文字设置链接。
    

![editor-audio-video.png](https://www.halo.run/upload/editor-audio-video.png)

![editor-image-iframe.png](https://www.halo.run/upload/editor-image-iframe.png)

![editor-link.png](https://www.halo.run/upload/editor-link.png)

## **完整变更日志**

### **新特性**

-   文章和自定义页面支持 `最后修改时间（lastModifyTime）` 变量。 by @guqing in [https://github.com/halo-dev/halo/pull/3101](https://github.com/halo-dev/halo/pull/3101)
    
-   插件安装和升级支持版本校验。 by @guqing in [https://github.com/halo-dev/halo/pull/3114](https://github.com/halo-dev/halo/pull/3114)
    
-   主题安装和升级支持版本校验。 by @guqing in [https://github.com/halo-dev/halo/pull/3150](https://github.com/halo-dev/halo/pull/3150) @ruibaby in [https://github.com/halo-dev/console/pull/826](https://github.com/halo-dev/console/pull/826)
    
-   Console 端的文章、独立页面、分类、标签支持自动生成别名。 by @ruibaby in [https://github.com/halo-dev/console/pull/831](https://github.com/halo-dev/console/pull/831)
    
-   Console 端新增系统概览页面，用于查看 Halo 运行环境和版本等数据。 by @JohnNiang in [https://github.com/halo-dev/halo/pull/3182](https://github.com/halo-dev/halo/pull/3182) @ruibaby in [https://github.com/halo-dev/console/pull/832](https://github.com/halo-dev/console/pull/832)
    
-   Console 端编辑器升级，支持图片、嵌入网页等内容的位置和大小设置，支持插入音频和视频，支持为选中的文字添加链接。 by @ruibaby in [https://github.com/halo-dev/console/pull/834](https://github.com/halo-dev/console/pull/834)
    
-   Console 端编辑器支持拖拽和粘贴图片上传到附件库。 by @ruibaby in [https://github.com/halo-dev/console/pull/825](https://github.com/halo-dev/console/pull/825)
    

### **功能优化**

-   主题端支持显示当前用户创建的未审核的评论。 by @guqing in [https://github.com/halo-dev/halo/pull/3102](https://github.com/halo-dev/halo/pull/3102)
    
-   优化主题端首页的排序规则，优先以文章发布时间排序。 by @longjuan in [https://github.com/halo-dev/halo/pull/3148](https://github.com/halo-dev/halo/pull/3148)
    
-   优化 Console 端评论列表默认排序规则，依据最后回复时间及评论创建时间进行排序。 by @vayci in [https://github.com/halo-dev/halo/pull/3149](https://github.com/halo-dev/halo/pull/3149) [https://github.com/halo-dev/console/pull/821](https://github.com/halo-dev/console/pull/821)
    
-   优化主题端归档页面中文章年份的排序规则，修改为以年份降序。 by @longjuan in [https://github.com/halo-dev/halo/pull/3158](https://github.com/halo-dev/halo/pull/3158)
    
-   插件安装后自动初始化 Setting 的默认值。 by @guqing in [https://github.com/halo-dev/halo/pull/3161](https://github.com/halo-dev/halo/pull/3161)
    
-   优化主题管理相关的权限设置。 by @guqing in [https://github.com/halo-dev/halo/pull/3135](https://github.com/halo-dev/halo/pull/3135) @ruibaby in [https://github.com/halo-dev/console/pull/820](https://github.com/halo-dev/console/pull/820)
    
-   优化插件管理相关的权限设置。 by @guqing in [https://github.com/halo-dev/halo/pull/3142](https://github.com/halo-dev/halo/pull/3142) @ruibaby in [https://github.com/halo-dev/console/pull/824](https://github.com/halo-dev/console/pull/824)
    
-   优化文章和自定义页面的内容查询，解决某些场景下文章渲染慢的问题。 by @guqing in [https://github.com/halo-dev/halo/pull/3168](https://github.com/halo-dev/halo/pull/3168) @ruibaby in [https://github.com/halo-dev/console/pull/828](https://github.com/halo-dev/console/pull/828)
    
-   Console 端去除上传文件处理时间超过 30 秒中断请求的限制。 by @longjuan in [https://github.com/halo-dev/console/pull/813](https://github.com/halo-dev/console/pull/813)
    
-   重构 Console 端的文章标签选择器，现在支持搜索和创建。 by @ruibaby in [https://github.com/halo-dev/console/pull/817](https://github.com/halo-dev/console/pull/817)
    
-   重构 Console 端的文章分类选择器，现在支持搜索和创建。 by @ruibaby in [https://github.com/halo-dev/console/pull/818](https://github.com/halo-dev/console/pull/818)
    
-   支持点击 Console 侧边栏 Logo 跳转到首页。 by @ruibaby in [https://github.com/halo-dev/console/pull/822](https://github.com/halo-dev/console/pull/822)
    
-   优化 Console 端加载插件资源的逻辑。 by @ruibaby in [https://github.com/halo-dev/console/pull/823](https://github.com/halo-dev/console/pull/823)
    
-   Console 附件管理的默认视图模式改为列表模式。 by @ruibaby in [https://github.com/halo-dev/console/pull/827](https://github.com/halo-dev/console/pull/827)
    

### **问题修复**

-   修复引入外部依赖的插件以开发模式启动时会出现 NoClassDefFoundError 的问题。 by @guqing in [https://github.com/halo-dev/halo/pull/3108](https://github.com/halo-dev/halo/pull/3108)
    
-   修复错误模板渲染无法获取登录信息的问题。 by @JohnNiang in [https://github.com/halo-dev/halo/pull/3152](https://github.com/halo-dev/halo/pull/3152)
    
-   解决主题自定义错误模板不生效的问题。 by @JohnNiang in [https://github.com/halo-dev/halo/pull/3166](https://github.com/halo-dev/halo/pull/3166)
    
-   修复因别名包含百分号导致无法正常访问的问题。 by @JohnNiang in [https://github.com/halo-dev/halo/pull/3179](https://github.com/halo-dev/halo/pull/3179)
    
-   修复 Console 端评论管理中删除某条评论后会导致下方评论头像错乱的问题。 by @AirboZH in [https://github.com/halo-dev/console/pull/830](https://github.com/halo-dev/console/pull/830)
    
-   修复 Console 端提示组件在文字过多时无法显示完整的问题。 by @wan92hen in [https://github.com/halo-dev/console/pull/829](https://github.com/halo-dev/console/pull/829)
    

### **重要变更**

-   主题描述文件的 `spec.require` 已废弃，变更为 `spec.requires`。 by @guqing in [https://github.com/halo-dev/halo/pull/3150](https://github.com/halo-dev/halo/pull/3150)
    
-   重构 Console 端页面管理，移除功能页面的功能，如果有使用相关插件需要升级到最新版本。 by @ruibaby in [https://github.com/halo-dev/console/pull/816](https://github.com/halo-dev/console/pull/816)
    

### **依赖更新**

-   升级 Spring Boot 至 3.0.2。 by @JohnNiang in [https://github.com/halo-dev/halo/pull/3176](https://github.com/halo-dev/halo/pull/3176)
    
-   升级 SpringDoc 至 2.0.2。 by @JohnNiang in [https://github.com/halo-dev/halo/pull/3186](https://github.com/halo-dev/halo/pull/3186)
    
-   升级 jasync-sql 至 2.1.23。 by @JohnNiang in [https://github.com/halo-dev/halo/pull/3192](https://github.com/halo-dev/halo/pull/3192)
    
-   升级 pf4j 至 3.9.0。 by @JohnNiang in [https://github.com/halo-dev/halo/pull/3191](https://github.com/halo-dev/halo/pull/3191)
    
-   升级 Lucene 至 9.5.0。 by @JohnNiang in [https://github.com/halo-dev/halo/pull/3190](https://github.com/halo-dev/halo/pull/3190)
    
-   Console 项目升级 Vite 至 4.0。 by @ruibaby in [https://github.com/halo-dev/console/pull/819](https://github.com/halo-dev/console/pull/819)
