# 增强内容管理功能和大量系统优化，Halo 2.17.0 发布

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

## ⚠️ 注意

此版本包含一些破坏性更新，在更新前请注意以下问题：

-   部分插件中使用的过时 API 已经在此版本中已移除，如果升级之后部分插件出现异常，建议先检查一下插件兼容性以及是否有新版本已经进行兼容。
    
-   为了能够更好的维护页面静态缓存功能，此版本将其封装为了单独的插件，如果有需要，请单独安装 [https://github.com/halo-sigs/plugin-page-cache](https://github.com/halo-sigs/plugin-page-cache) 插件。
    

* * *

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

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

2024 年 07 月 02 日，强大易用的开源建站工具 Halo 正式发布 2.17.0 版本。

在这个版本中，Halo 主要增强了内容管理功能以及大量针对插件和主题开发的改进，以及其他 50 多项功能优化和问题修复。

## **亮点更新**

### 文章批量管理

在 2.17 版本中，我们为文章管理添加了批量管理的功能，现在你可以选择一批文章，然后批量发布或者取消发布。

![2.17-post-batch-publish.png](https://www.halo.run/upload/2.17-post-batch-publish.png)

或者点击**批量设置**按钮，可以打开属性批量设置的界面，在这个界面，你可以批量设置文章分类、标签、作者等。

![2.17-post-batch-settings.png](https://www.halo.run/upload/2.17-post-batch-settings.png)

### 文章分类管理

在 2.17 版本中，我们优化了文章分类的管理功能，现在你可以将分类隐藏，让其中的文章不再显示在默认的文章列表中，然后使用单独的访问入口进行访问。利用此功能可以让你的网站更好的实现内容划分，可以用于实现单独的新闻中心、案例中心等模块。

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

此外，现在也可以统一在分类中设置自定义的文章渲染模板，如果你使用的主题提供了多套文章渲染模板，可以直接在分类中设置，而不再需要单独为文章设置。

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

### 编辑器改进

在 2.17 版本中，我们优化了文章编辑器的代码快样式，并支持了复制、折叠功能。

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

![2.17-editor-code-block-2.png](https://www.halo.run/upload/2.17-editor-code-block-2.png)

### 登录设备管理

在 2.17 版本中，我们为用户引入了登录设备管理的功能，现在你可以在个人中心查看当前所有的登录设备，如果有需要，你也可以移除设备的登录状态。

![2.17-user-devices.png](https://www.halo.run/upload/2.17-user-devices.png)

## **完整更新日志**

### 破坏性更新

-   移除过时 API **ExtensionComponentsFinder**。 by [@JohnNiang](https://github.com/JohnNiang) in [#6185](https://github.com/halo-dev/halo/pull/6185)
    
-   移除内置的页面静态缓存功能，后续由 [https://github.com/halo-sigs/plugin-page-cache](https://github.com/halo-sigs/plugin-page-cache) 插件提供。 by [@ruibaby](https://github.com/ruibaby) in [#6108](https://github.com/halo-dev/halo/pull/6108)
    

### 新特性

-   支持手动为文章设置作者。 by [@ruibaby](https://github.com/ruibaby) in [#6178](https://github.com/halo-dev/halo/pull/6178)
    
-   为单个主题配置增加导入与导出的功能。 by [@LIlGG](https://github.com/LIlGG) in [#6071](https://github.com/halo-dev/halo/pull/6071)
    
-   新增设备管理功能，允许管理已登录你账号的设备并随时移除可疑设备。 by [@guqing](https://github.com/guqing) in [#6100](https://github.com/halo-dev/halo/pull/6100)
    
-   支持在分类上为关联的文章统一设置渲染模板。 by [@guqing](https://github.com/guqing) in [#6106](https://github.com/halo-dev/halo/pull/6106)
    
-   新增独立分类选项用于控制关联的子分类下的文章显示以提供更灵活的内容管理方式。 by [@guqing](https://github.com/guqing) in [#6083](https://github.com/halo-dev/halo/pull/6083)
    
-   允许为分类设置是否从列表中隐藏。 by [@guqing](https://github.com/guqing) in [#6116](https://github.com/halo-dev/halo/pull/6116)
    
-   支持批量发布/取消发布文章。 by [@ruibaby](https://github.com/ruibaby) in [#6123](https://github.com/halo-dev/halo/pull/6123)
    
-   支持批量为文章设置部分属性。 by [@ruibaby](https://github.com/ruibaby) in [#6142](https://github.com/halo-dev/halo/pull/6142)
    
-   添加系统扩展点的查看和设置页面。 by [@ruibaby](https://github.com/ruibaby) in [#6137](https://github.com/halo-dev/halo/pull/6137)
    
-   文章分类和标签的编辑表单支持保存并继续添加。 [@LonelySnowman](https://github.com/LonelySnowman) in [#6223](https://github.com/halo-dev/halo/pull/6223)
    

### 功能优化

-   优化 Console 中多选框的禁用样式。 by [@longjuan](https://github.com/longjuan) in [#6220](https://github.com/halo-dev/halo/pull/6220)
    
-   支持通过配置的方式全局禁用二步验证。 by [@JohnNiang](https://github.com/JohnNiang) in [#6242](https://github.com/halo-dev/halo/pull/6242)
    
-   支持在文章编辑页面创建文章时，也应用别名生成规则。 by [@ruibaby](https://github.com/ruibaby) in [#6205](https://github.com/halo-dev/halo/pull/6205)
    
-   添加对菜单的限制，不能删除已经设置为主菜单的菜单。 by [@ruibaby](https://github.com/ruibaby) in [#6203](https://github.com/halo-dev/halo/pull/6203)
    
-   优化文章编辑器内容区域在低分屏下的表现。 by [@ruibaby](https://github.com/ruibaby) in [#6175](https://github.com/halo-dev/halo/pull/6175)
    
-   为默认编辑器代码块增加折叠功能。 by [@LIlGG](https://github.com/LIlGG) in [#6177](https://github.com/halo-dev/halo/pull/6177)
    
-   默认编辑器图片跳转链接支持配置新窗口打开。 by [@LIlGG](https://github.com/LIlGG) in [#6170](https://github.com/halo-dev/halo/pull/6170)
    
-   重构索引机制的查询和排序使整体性能提升 50% 以上。 by [@guqing](https://github.com/guqing) in [#6039](https://github.com/halo-dev/halo/pull/6039)
    
-   优化默认编辑器代码块样式。 by [@LIlGG](https://github.com/LIlGG) in [#6089](https://github.com/halo-dev/halo/pull/6089)
    
-   优化默认编辑器代码块缩进为两个空格。 by [@LIlGG](https://github.com/LIlGG) in [#6090](https://github.com/halo-dev/halo/pull/6090)
    
-   为默认编辑器的块级节点增加间隙光标的功能。 by [@LIlGG](https://github.com/LIlGG) in [#6103](https://github.com/halo-dev/halo/pull/6103)
    
-   为默认编辑器添加 RangeSelection 选择器。 by [@LIlGG](https://github.com/LIlGG) in [#6117](https://github.com/halo-dev/halo/pull/6117)
    
-   优化文章编辑页面自动保存标题的功能。 by [@ruibaby](https://github.com/ruibaby) in [#6122](https://github.com/halo-dev/halo/pull/6122)
    
-   引入基于持久化 Token 的新 RememberMe 机制以增强安全性和管理灵活性，升级后需要重新登录。 by [@guqing](https://github.com/guqing) in [#6131](https://github.com/halo-dev/halo/pull/6131)
    

### 问题修复

-   修复当插件入口文件的缓存目录被系统清理后会导致一直无法加载的问题。 [@guqing](https://github.com/guqing) in [#6238](https://github.com/halo-dev/halo/pull/6238)
    
-   修复当启动插件遇到 Error 级别的错误时会导致 API 被挂起无法终止的问题。 by [@guqing](https://github.com/guqing) in [#6207](https://github.com/halo-dev/halo/pull/6207)
    
-   修复在没有配置 TOTP 验证器的情况下仍被要求二步验证的问题。 by [@JohnNiang](https://github.com/JohnNiang) in [#6174](https://github.com/halo-dev/halo/pull/6174)
    
-   修复查询分类的排序条件拼写错误导致的错误。 by [@guqing](https://github.com/guqing) in [#6173](https://github.com/halo-dev/halo/pull/6173)
    
-   修复系统设置未保存导致无法正常注册的问题 by [@ruibaby](https://github.com/ruibaby) in [#6035](https://github.com/halo-dev/halo/pull/6035)
    
-   修复 Tag 组件的图标为空时，Tag 中的内容没有居中的问题。 by [@ShiinaKin](https://github.com/ShiinaKin) in [#6040](https://github.com/halo-dev/halo/pull/6040)
    
-   修复首次初始化后无法正常访问主题资源的问题。 by [@JohnNiang](https://github.com/JohnNiang) in [#6049](https://github.com/halo-dev/halo/pull/6049)
    
-   解决在默认编辑器中粘贴的内容无法生成标题 ID 的问题。 by [@LIlGG](https://github.com/LIlGG) in [#6059](https://github.com/halo-dev/halo/pull/6059)
    
-   解决使用默认编辑器时无法正确设置焦点的问题。 by [@LIlGG](https://github.com/LIlGG) in [#6062](https://github.com/halo-dev/halo/pull/6062)
    
-   修复已验证邮箱可以重复的问题。 by [@guqing](https://github.com/guqing) in [#6064](https://github.com/halo-dev/halo/pull/6064)
    
-   修复新建文章时，没有自动选择之前所选编辑器的问题。 by [@ruibaby](https://github.com/ruibaby) in [#6114](https://github.com/halo-dev/halo/pull/6114)
    
-   修复首次上传附件时，没有默认选择第一个存储策略的问题。 by [@ruibaby](https://github.com/ruibaby) in [#6115](https://github.com/halo-dev/halo/pull/6115)
    
-   解决文章自动保存失效的问题。 by [@LIlGG](https://github.com/LIlGG) in [#6147](https://github.com/halo-dev/halo/pull/6147)
    
-   处理默认编辑器中 iframe 标签的 src 属性可能存在的风险。 by [@LIlGG](https://github.com/LIlGG) in [#6150](https://github.com/halo-dev/halo/pull/6150)
    

### 开发者相关

-   新增 LoginHandlerEnhancer 用于 Halo 扩展登录成功或失败后的处理逻辑。 by [@guqing](https://github.com/guqing) in [#6176](https://github.com/halo-dev/halo/pull/6176)
    
-   支持在插件中监听插件的启动事件。 by [@JohnNiang](https://github.com/JohnNiang) in [#6234](https://github.com/halo-dev/halo/pull/6234)
    
-   为 UI 添加通用的插件设置弹窗，以供插件主动调用。 by [@ruibaby](https://github.com/ruibaby) in [#6233](https://github.com/halo-dev/halo/pull/6233)
    
-   为插件提供全文搜索服务。 by [@JohnNiang](https://github.com/JohnNiang) in [#6239](https://github.com/halo-dev/halo/pull/6239)
    
-   支持在主题模板中检查已启动的插件是否符合指定的版本要求。 by [@guqing](https://github.com/guqing) in [#6236](https://github.com/halo-dev/halo/pull/6236)
    
-   提供对模板中 `<halo:footer />` 标签内容的扩展点以支持通过插件扩展页脚内容。 by [@guqing](https://github.com/guqing) in [#6191](https://github.com/halo-dev/halo/pull/6191)
    
-   为分类 Finder 提供获取指定节点的面包屑路径方法。 by [@guqing](https://github.com/guqing) in [#6135](https://github.com/halo-dev/halo/pull/6135)
    
-   为 FormKit 添加 Secret 选择组件。 by [@ruibaby](https://github.com/ruibaby) in [#6140](https://github.com/halo-dev/halo/pull/6140)
    
-   重构请求库并将 `@halo-dev/api-client` 作为全局共享依赖，开放给插件和外部应用程序使用。 by [@ruibaby](https://github.com/ruibaby) in [#6132](https://github.com/halo-dev/halo/pull/6132)
    
-   添加 AvatarGroup 组件，用于堆叠多个头像。 by [@ruibaby](https://github.com/ruibaby) in [#6128](https://github.com/halo-dev/halo/pull/6128)
    
-   为 Formkit 增加动态列表的组件。 by [@LIlGG](https://github.com/LIlGG) in [#6146](https://github.com/halo-dev/halo/pull/6146)
    
-   重构搜索引擎并提高可扩展性。 by [@JohnNiang](https://github.com/JohnNiang) in [#6082](https://github.com/halo-dev/halo/pull/6082)
    
-   为自定义模型添加 patch 类型的接口支持。 by [@JohnNiang](https://github.com/JohnNiang) in [#6031](https://github.com/halo-dev/halo/pull/6031)
    
-   将文章相关的事件移动至 api 模块以暴露给插件使用。 by [@JohnNiang](https://github.com/JohnNiang) in [#6052](https://github.com/halo-dev/halo/pull/6052)
    
-   为插件提供发送共享事件的支持。 by [@JohnNiang](https://github.com/JohnNiang) in [#6081](https://github.com/halo-dev/halo/pull/6081)
    
-   重构 OpenAPI 文档分组。 by [@JohnNiang](https://github.com/JohnNiang) in [#6130](https://github.com/halo-dev/halo/pull/6130)
    
-   增强插件配置的缓存管理并支持通过监听 `PluginConfigUpdatedEvent` 事件做一些特殊处理。 by [@guqing](https://github.com/guqing) in [#6141](https://github.com/halo-dev/halo/pull/6141)
    
-   重构 ControllerBuilder 的匹配条件并增加 syncAllListOptions 作为启动时同步的查询条件。 by [@guqing](https://github.com/guqing) in [#6145](https://github.com/halo-dev/halo/pull/6145)
    
-   支持通过 Builder 来简化 ListOptions 的构建。 by [@guqing](https://github.com/guqing) in [#6148](https://github.com/halo-dev/halo/pull/6148)
    

### 依赖更新

-   升级 SpringDoc 至 2.6.0。 by [@JohnNiang](https://github.com/JohnNiang) in [#6227](https://github.com/halo-dev/halo/pull/6227)
    
-   升级 Lucene 至 9.11.1。 by [@JohnNiang](https://github.com/JohnNiang) in [#6188](https://github.com/halo-dev/halo/pull/6188)
    
-   升级 Spring Boot 至 3.3.1。 by [@JohnNiang](https://github.com/JohnNiang) in [#6110](https://github.com/halo-dev/halo/pull/6110)
    
-   升级 MariaDB 的原生驱动版本至 [1.2.1](https://github.com/mariadb-corporation/mariadb-connector-r2dbc/releases/tag/1.2.1)，以解决使用 MariaDB 无法正常部署的问题。 by [@ruibaby](https://github.com/ruibaby) in [#6133](https://github.com/halo-dev/halo/pull/6133)
    
-   升级 pf4j 至 3.12.0 版本以解决插件依赖解析不正确的问题。 by [@guqing](https://github.com/guqing) in [#6143](https://github.com/halo-dev/halo/pull/6143)
