# 开放公共 API，Halo 2.5.0 发布

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

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

截至目前（2023 年 3 月 31 日），Halo 已经在 Docker Hub 获得了超过 170 万次下载，GitHub Star 数突破 26 k，并拥有一百多名社区贡献者。

2023 年 4 月 28 日，强大易用的开源建站工具 Halo 正式发布 2.5.0 版本。  

在这个版本中，Halo 主要提供了一套为访客端提供数据访问的 API，你可以根据需要结合主流的前端渲染框架来构建网站。此外，这个版本还带来了 30 多项的功能更新和问题修复。非常感谢大家的反馈和支持。

## 亮点更新

### API

从 2.5.0 开始，Halo 为访客端提供了一套公开的 API，大家可以在此基础上结合目前主流的前端渲染框架如 Next.js、Nuxt.js、Astro 等来构建网站，使用 API 做数据交互可以让构建页面更加灵活，可以将 Halo 作为一个 Headless CMS 来使用。后续我们还会提供结合其他框架的使用例子。

### SEO 优化

此版本优化了文章页面的 SEO，可以自动将文章摘要设置为 Meta Description。

### 固定链接优化

从 2.0.0 开始，在搭建 Halo 的时候会要求配置外部访问地址以生成系统内部资源的固定访问链接。但根据后续用户的反馈，此设置可能会造成一定程度的困扰，不少用户在搭建完成之后，由于外部访问地址设置不正确，会导致很多页面无法正常跳转和访问，同时可能对于多域名访问的场景也不能够很好的兼容。所以在这个版本中，我们提供了一个新的配置 `use-absolute-permalink` 用来设置是否需要生成绝对路径的访问链接，并默认设置为 false，即默认生成相对路径的访问链接。这样一来，即便是以后需要更换域名，也不会因为配置不正确导致链接生成错误。

## 应用市场

随着 Halo 2.5.0 的发布，我们重新设计了 Halo 的官网，并上线了全新的应用市场。在应用市场中，你可以轻松浏览和搜索各种插件和主题，以满足不同的需求。我们期望通过应用市场建立更加强大和丰富的生态，使 Halo 能够适用于各种各样的使用场景。此外，我们还将支持第三方开发者将自己的主题或插件上传到应用市场，以便其他用户使用和下载。在应用市场更加成熟之后，我们会将其集成到 Halo 的管理后台中。

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

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

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

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

## **新特性**

-   提供繁体中文（zh-TW）翻译。 by @den13501 in [https://github.com/halo-dev/halo/pull/3672](https://github.com/halo-dev/halo/pull/3672)
    
-   对初始超级管理员用户名增加合法性校验。 by @guqing in [https://github.com/halo-dev/halo/pull/3744](https://github.com/halo-dev/halo/pull/3744)
    
-   将文章摘要作为 Meta description 以优化文章页的 SEO。 by @guqing in [https://github.com/halo-dev/halo/pull/3745](https://github.com/halo-dev/halo/pull/3745)
    
-   新增是否生成相对地址的配置。 by @JohnNiang in [https://github.com/halo-dev/halo/pull/3772](https://github.com/halo-dev/halo/pull/3772)
    
-   为访客端提供一套完整的 API。 by @guqing in [https://github.com/halo-dev/halo/pull/3787](https://github.com/halo-dev/halo/pull/3787)
    

## **功能优化**

-   允许用户修改自己的元数据信息。 by @guqing in [https://github.com/halo-dev/halo/pull/3739](https://github.com/halo-dev/halo/pull/3739)
    
-   优化 Console 端安装和升级主题的流程，支持自动关闭安装弹框和显示反馈提示。 by @ruibaby in [https://github.com/halo-dev/halo/pull/3777](https://github.com/halo-dev/halo/pull/3777)
    
-   优化 Console 端激活主题的流程，支持激活后自动刷新页面。 by @ruibaby in [https://github.com/halo-dev/halo/pull/3779](https://github.com/halo-dev/halo/pull/3779)
    
-   优化 Console 端上传附件的弹框，支持点击完成按钮以关闭弹框。 by @ruibaby in [https://github.com/halo-dev/halo/pull/3784](https://github.com/halo-dev/halo/pull/3784)
    
-   优化用户账号创建流程，支持同时设置密码和角色。 by @guqing in [https://github.com/halo-dev/halo/pull/3803](https://github.com/halo-dev/halo/pull/3803)
    
-   为 FormKit 表单中包含了 required 验证的表单元素的 label 添加指示器（\*），优化可访问性。 by @ruibaby in [https://github.com/halo-dev/halo/pull/3824](https://github.com/halo-dev/halo/pull/3824)
    
-   优化 Console 端附件库的图片渲染性能。 by @ruibaby in [https://github.com/halo-dev/halo/pull/3831](https://github.com/halo-dev/halo/pull/3831)
    
-   Console 端的附件详情添加复制链接的功能。 by @ruibaby in [https://github.com/halo-dev/halo/pull/3835](https://github.com/halo-dev/halo/pull/3835)
    
-   升级预设插件的版本。 by @JohnNiang in [https://github.com/halo-dev/halo/pull/3854](https://github.com/halo-dev/halo/pull/3854)
    
-   优化插件的升级流程。 by @guqing in [https://github.com/halo-dev/halo/pull/3838](https://github.com/halo-dev/halo/pull/3838)
    

## **问题修复**

-   修复登录成功或失败后报错的问题。 by @JohnNiang in [https://github.com/halo-dev/halo/pull/3658](https://github.com/halo-dev/halo/pull/3658)
    
-   修复 Console 端附件存储策略编辑表单无法正常渲染的问题。 by @ruibaby in [https://github.com/halo-dev/halo/pull/3663](https://github.com/halo-dev/halo/pull/3663)
    
-   修复后台全局搜索中关于 Console 路由的文字没有适配 i18n 的问题。 by @ruibaby in [https://github.com/halo-dev/halo/pull/3665](https://github.com/halo-dev/halo/pull/3665)
    
-   修复 Console 端 FormKit Schema 生成的表单中，Radio 输入类型值类型为 boolean 但结果为 string 的问题。 by @ruibaby in [https://github.com/halo-dev/halo/pull/3668](https://github.com/halo-dev/halo/pull/3668)
    
-   修复 Console 端文章设置中的发布时间无法回显导致重新保存时丢失发布时间的问题。 by @ruibaby in [https://github.com/halo-dev/halo/pull/3671](https://github.com/halo-dev/halo/pull/3671)
    
-   升级 `@halo-dev/richtext-editor` 的版本以解决编辑器部分文本翻译不完整的问题。 by @ruibaby in [https://github.com/halo-dev/halo/pull/3682](https://github.com/halo-dev/halo/pull/3682)
    
-   修复保存系统设置之后导致激活主题的设置值丢失，恢复为了默认主题的问题。 by @ruibaby in [https://github.com/halo-dev/halo/pull/3691](https://github.com/halo-dev/halo/pull/3691)
    
-   修复 Console 端预览主题页面的设置表单可能出现无法渲染的问题。 by @ruibaby in [https://github.com/halo-dev/halo/pull/3706](https://github.com/halo-dev/halo/pull/3706)
    
-   解决反向代理后无法正确获取当前请求 URI 的问题。 by @JohnNiang in [https://github.com/halo-dev/halo/pull/3709](https://github.com/halo-dev/halo/pull/3709)
    
-   修复 Console 端菜单项和菜单关联可能发现混乱的问题。 by @ruibaby in [https://github.com/halo-dev/halo/pull/3714](https://github.com/halo-dev/halo/pull/3714)
    
-   修复 Console 端主题设置中，选项卡会重复显示的问题。 by @LIlGG in [https://github.com/halo-dev/halo/pull/3727](https://github.com/halo-dev/halo/pull/3727)
    
-   修复作者页无法访问的问题。 by @guqing in [https://github.com/halo-dev/halo/pull/3736](https://github.com/halo-dev/halo/pull/3736)
    
-   修复在 1080P 屏幕下，登录页面的样式问题。 by @hughding in [https://github.com/halo-dev/halo/pull/3756](https://github.com/halo-dev/halo/pull/3756)
    
-   修复 Console 端仪表盘添加组件时的报错问题。 by @LIlGG in [https://github.com/halo-dev/halo/pull/3770](https://github.com/halo-dev/halo/pull/3770)
    
-   修复文章/页面已有内容重新编辑时，无法立即显示大纲的问题。 by @LIlGG in [https://github.com/halo-dev/halo/pull/3773](https://github.com/halo-dev/halo/pull/3773)
    
-   修复 Console 端升级插件之后没有自动刷新页面的问题。 by @ruibaby in [https://github.com/halo-dev/halo/pull/3781](https://github.com/halo-dev/halo/pull/3781)
    
-   修复 Console 端插件详情页面中角色模板无法正常加载的问题。 by @ruibaby in [https://github.com/halo-dev/halo/pull/3794](https://github.com/halo-dev/halo/pull/3794)
    
-   修复 Console 端的文章分类和标签选择组件在 Repeater 组件中，下拉框无法完整显示的问题。 by @ruibaby in [https://github.com/halo-dev/halo/pull/3819](https://github.com/halo-dev/halo/pull/3819)
    
-   修复当插件异常时，无法正常升级插件的问题。 by @JohnNiang in [https://github.com/halo-dev/halo/pull/3836](https://github.com/halo-dev/halo/pull/3836)
    
-   修复插件安装后无法启动会导致卸载后插件 JAR 文件残留的问题。 by @guqing in [https://github.com/halo-dev/halo/pull/3841](https://github.com/halo-dev/halo/pull/3841)
    
-   修复隐藏的文章依然能够被搜索到的问题。 by @JohnNiang in [https://github.com/halo-dev/halo/pull/3859](https://github.com/halo-dev/halo/pull/3859)
    
-   修复页面链接包含中文等字符后无法访问的问题。 by @ruibaby in [https://github.com/halo-dev/halo/pull/3867](https://github.com/halo-dev/halo/pull/3867)
    

## **依赖更新**

-   升级 Spring Boot 至 3.0.6。 by @JohnNiang in [https://github.com/halo-dev/halo/pull/3832](https://github.com/halo-dev/halo/pull/3832)
    
-   升级 Console 端 `@tanstack/vue-query` 依赖的版本至 [v4.29.1](https://github.com/TanStack/query/releases/tag/v4.29.1) by @ruibaby in [https://github.com/halo-dev/halo/pull/3771](https://github.com/halo-dev/halo/pull/3771)
    

## **开发者相关**

-   支持在插件中定义 Reconciler。 by @JohnNiang in [https://github.com/halo-dev/halo/pull/3789](https://github.com/halo-dev/halo/pull/3789)
    
-   为 Console 端 FormKit 的 group 输入组件重构布局和样式。 by @ruibaby in [https://github.com/halo-dev/halo/pull/3786](https://github.com/halo-dev/halo/pull/3786)
    
-   为 Console 端添加 Description 组件。 by @ruibaby in [https://github.com/halo-dev/halo/pull/3792](https://github.com/halo-dev/halo/pull/3792)
    
-   Console 端的附件选择组件支持 accepts、min、max 参数用来限定文件格式和数量。 by @ruibaby in [https://github.com/halo-dev/halo/pull/3827](https://github.com/halo-dev/halo/pull/3827)
