Compare commits

..

2 Commits

Author SHA1 Message Date
Ryan Wang 479682dc03 Update tencent-cloud-lighthouse.md
8 months ago
BugKing 41416c7d47
docs: Update tencent-cloud-lighthouse.md
8 months ago

@ -9,7 +9,7 @@ description: 问题反馈渠道及指南
## GitHub Issues
链接:[https://github.com/halo-dev/halo/issues](https://github.com/halo-dev/halo/issues)
链接:<https://github.com/halo-dev/halo/issues>
如果你在使用过程中,遇到了一些 bug 或者需要添加某些新特性,请尽量在 GitHub Issues 进行反馈,这非常有助于我们跟踪解决此问题,您也可以很方便的接收到处理状态。
@ -23,6 +23,6 @@ description: 问题反馈渠道及指南
## Halo 官方社区
链接:[https://bbs.halo.run](https://bbs.halo.run)
链接:<https://bbs.halo.run>
此平台主要目的用于与其他 Halo 用户进行交流。但如果您对 GitHub 不是很熟悉或者没有账号,您也可以在此平台进行反馈。

@ -15,12 +15,12 @@ description: 如果 Halo 对你有帮助,不妨赞助我们
### 资金赞助
- 爱发电:[https://afdian.com/a/halo-dev](https://afdian.com/a/halo-dev)
- 爱发电:<https://afdian.net/a/halo-dev>
### 通过我们的推广链接购买服务器
如果你当前还没有购买服务器,可以考虑通过以下链接购买,这会为我们带来一部分收益。
- 阿里云:[https://www.aliyun.com/daily-act/ecs/activity_selection?userCode=j57gyupo](https://www.aliyun.com/daily-act/ecs/activity_selection?userCode=j57gyupo)
- 阿里云新人专享:[https://www.aliyun.com/minisite/goods?userCode=j57gyupo](https://www.aliyun.com/minisite/goods?userCode=j57gyupo)
- 腾讯云:[https://curl.qcloud.com/9Ogon25Y](https://curl.qcloud.com/9Ogon25Y)
- 阿里云:<https://www.aliyun.com/daily-act/ecs/activity_selection?userCode=j57gyupo>
- 阿里云新人专享:<https://www.aliyun.com/minisite/goods?userCode=j57gyupo>
- 腾讯云:<https://curl.qcloud.com/9Ogon25Y>

@ -33,7 +33,7 @@ git checkout ${branch_name}
## 构建 Fat Jar
构建之前需要修改 `gradle.properties` 中的 `version` 属性(推荐遵循 [SemVer 规范](https://semver.org/)),例如:`version=2.18.0`
构建之前需要修改 `gradle.properties` 中的 `version` 属性(推荐遵循 [SemVer 规范](https://semver.org/)),例如:`version=2.17.0`
```bash
cd path/to/halo

@ -117,6 +117,6 @@ halo:
```
6. 最终提供以下访问地址:
1. 网站首页:[http://localhost:8090](http://localhost:8090)
2. Console 控制台:[http://localhost:8090/console](http://localhost:8090/console)
3. UC 个人中心:[http://localhost:8090/uc](http://localhost:8090/uc)
1. 网站首页:<http://localhost:8090>
2. Console 控制台:<http://localhost:8090/console>
3. UC 个人中心:<http://localhost:8090/uc>

@ -8,8 +8,8 @@ title: 表单定义
FormKit 相关文档:
- Form Schema: [https://formkit.com/essentials/schema](https://formkit.com/essentials/schema)
- FormKit Inputs: [https://formkit.com/inputs](https://formkit.com/inputs)
- Form Schema: <https://formkit.com/essentials/schema>
- FormKit Inputs: <https://formkit.com/inputs>
:::tip
目前不支持 FormKit Pro 中的输入组件,但 Halo 额外提供了部分输入组件,将在下面文档列出。

@ -1,6 +1,6 @@
---
title: 与自定义模型交互
description: 了解如通过代码的方式操作数据
description: 了解如通过代码的方式操作数据
---
Halo 提供了两个类用于与自定义模型对象交互 `ExtensionClient``ReactiveExtensionClient`

@ -1,72 +0,0 @@
---
title: 获取扩展
description: 了解如何在插件中使用 `ExtensionGetter` 获取扩展
---
`ExtensionGetter` 用于获取和管理 Halo 或其他插件提供的扩展。它提供了多种方法来根据扩展点获取扩展,确保插件能够灵活地集成和使用各种扩展功能。
`ExtensionGetter` 接口的定义如下:
```java
public interface ExtensionGetter {
/**
* Get only one enabled extension from system configuration.
*
* @param extensionPoint is extension point class.
* @return implementation of the corresponding extension point. If no configuration is found,
* we will use the default implementation from application context instead.
*/
<T extends ExtensionPoint> Mono<T> getEnabledExtension(Class<T> extensionPoint);
/**
* Get the extension(s) according to the {@link ExtensionPointDefinition} queried
* by incoming extension point class.
*
* @param extensionPoint extension point class
* @return implementations of the corresponding extension point.
* @throws IllegalArgumentException if the incoming extension point class does not have
* the {@link ExtensionPointDefinition}.
*/
<T extends ExtensionPoint> Flux<T> getEnabledExtensions(Class<T> extensionPoint);
/**
* Get all extensions according to extension point class.
*
* @param extensionPointClass extension point class
* @param <T> type of extension point
* @return a bunch of extension points.
*/
<T extends ExtensionPoint> Flux<T> getExtensions(Class<T> extensionPointClass);
}
```
包含以下方法:
1. `getEnabledExtension(Class<T> extensionPoint)`: 获取一个在扩展设置中已启用的扩展。如果没有找到对应配置,将使用 Halo 中的默认扩展,如果 Halo 没有提供默认实现则找到一个由**已启用插件**提供的可用扩展。
2. `getEnabledExtensions(Class<T> extensionPoint)`: 根据传入的扩展点类获取所有已启用扩展。如果没有在扩展设置页面配置过则会返回所有可用的扩展。
3. `getExtensions(Class<T> extensionPointClass)`: 获取所有与扩展点类相关的扩展,无论是否在扩展设置中启用它。
:::tip Note
使用 `getEnabledExtension` 方法或者 `getEnabledExtensions` 方法取决于扩展点声明的 `type``SINGLETON` 还是 `MULTI_INSTANCE`
通过使用 `ExtensionGetter`,开发者可以轻松地在插件中访问和管理各种扩展点,提升插件的功能和灵活性。
如果想了解 Halo 提供的扩展点请参考:[扩展点](./extension-points/index.md)。
:::
### 示例
如果你想在插件中获取已启用的搜索引擎扩展,可以使用 `ExtensionGetter` 来获取:
```java
@Service
@RequiredArgsConstructor
public class SearchService {
private final ExtensionGetter extensionGetter;
Mono<SearchEngine> getSearchEngine() {
return extensionGetter.getEnabledExtension(SearchEngine.class)
}
}
```

@ -1,6 +1,6 @@
---
title: 静态资源代理
description: 了解如使用静态资源代理来访问插件中的静态资源
description: 了解如使用静态资源代理来访问插件中的静态资源
---
插件中的静态资源如图片等如果想被外部访问到,需要放到 `src/main/resources` 目录下,并通过创建 `ReverseProxy` 自定义模型对象来进行静态资源代理访问。

@ -1,6 +1,6 @@
---
title: API 权限控制
description: 了解如对插件中的 API 定义角色模板以接入权限控制
description: 了解如对插件中的 API 定义角色模板以接入权限控制
---
插件中的 APIs 无论是自定义模型自动生成的 APIs 或者是通过 `@Controller` 自定义的 APIs 都只有超级管理员能够访问,如果想将这些 APIs 授权给其他用户访问,

@ -52,4 +52,4 @@ function handleSubmit () {
|---------|------------------------------------|---------|-----------------------------------------|
| `group` | string | 无,必填 | 定义组件所属的分组。 |
| `kind` | string | 无,必填 | 定义组件的种类。 |
| `value` | \{ [key: string]: string; \} \| null \| null | 可选,包含键值对的对象或空值,用于存储数据。 |
| `value` | { [key: string]: string; } \| null | null | 可选,包含键值对的对象或空值,用于存储数据。 |

@ -37,7 +37,7 @@ const items = [
| 属性名 | 类型 | 默认值 | 描述 |
|--------------|-----------------------------------------------------------|-----------|--------------------------------------------------|
| `items` | \{ label: string; value?: string \| boolean \| number; \}[] | 无,必填 | 包含 `label` 和可选 `value` 的对象数组。 |
| `items` | { label: string; value?: string \| boolean \| number; }[] | 无,必填 | 包含 `label` 和可选 `value` 的对象数组。 |
| `label` | string | 无,必填 | 组件的标签文本。 |
| `modelValue` | string \| boolean \| number | undefined | 可选,用于绑定到组件的值,可以是字符串、布尔值或数字。 |

@ -27,7 +27,7 @@ import { VButton } from "@halo-dev/components";
</template>
```
所有可用的基础组件以及文档可查阅:[https://halo-ui-components.pages.dev](https://halo-ui-components.pages.dev)
所有可用的基础组件以及文档可查阅:<https://halo-ui-components.pages.dev>
## 业务组件和指令

@ -27,7 +27,7 @@ const groupName = ref('my-test-group')
| 属性名 | 类型 | 默认值 | 描述 |
|---------------------|----------------------------------------------------------------|-----------|------------------------------|
| `restrictions` | Restrictions | undefined | 可选,指定任何限制。 |
| `meta` | Record\<string, unknown\> | undefined | 可选,要发送的额外元数据。 |
| `meta` | Record<string, unknown> | undefined | 可选,要发送的额外元数据。 |
| `autoProceed` | boolean | false | 可选,在某些操作后自动继续。 |
| `allowedMetaFields` | string[] | undefined | 可选,指定允许的元数据字段。 |
| `endpoint` | string | 无,必填 | 数据发送到的端点URL。 |

@ -85,7 +85,7 @@ export default definePlugin({
## 实现案例
- [https://github.com/halo-dev/plugin-s3](https://github.com/halo-dev/plugin-s3)
- <https://github.com/halo-dev/plugin-s3>
## 类型定义

@ -143,4 +143,4 @@ const handleSelect = async (url: string) => {
## 实现案例
- [https://github.com/halo-sigs/plugin-unsplash](https://github.com/halo-sigs/plugin-unsplash)
- <https://github.com/halo-sigs/plugin-unsplash>

@ -1,81 +0,0 @@
---
title: 评论数据列表操作菜单
description: 扩展评论数据列表操作菜单 - comment:list-item:operation:create
---
此扩展点用于扩展评论数据列表的操作菜单项。
![评论数据列表操作菜单](/img/developer-guide/plugin/api-reference/ui/extension-points/comment-list-item-operation-create.png)
## 定义方式
```ts
export default definePlugin({
extensionPoints: {
"comment:list-item:operation:create": (
comment: Ref<ListedComment>
): OperationItem<ListedComment>[] | Promise<OperationItem<ListedComment>[]> => {
return [
{
priority: 10,
component: markRaw(VDropdownItem),
props: {},
action: (item?: ListedComment) => {
// do something
},
label: "foo",
hidden: false,
permissions: [],
children: [],
},
];
},
},
});
```
```mdx-code-block
import OperationItem from "./interface/OperationItem.md";
<OperationItem />
```
## 示例
此示例将实现一个操作菜单项。
```ts
import type { ListedComment } from "@halo-dev/api-client";
import { VDropdownItem } from "@halo-dev/components";
import { definePlugin } from "@halo-dev/console-shared";
import { markRaw } from "vue";
export default definePlugin({
extensionPoints: {
"comment:list-item:operation:create": () => {
return [
{
priority: 21,
component: markRaw(VDropdownItem),
label: "测试评论菜单",
visible: true,
permissions: [],
action: async (comment: ListedComment) => {
console.log(comment)
},
},
];
},
},
});
```
## 类型定义
### ListedComment
```mdx-code-block
import ListedComment from "./interface/ListedComment.md";
<ListedComment />
```

@ -111,4 +111,4 @@ const stripHtmlTags = (str: string) => {
## 实现案例
- [https://github.com/halo-sigs/plugin-moments](https://github.com/halo-sigs/plugin-moments)
- <https://github.com/halo-sigs/plugin-moments>

@ -18,7 +18,7 @@ export default definePlugin({
```
:::info 提示
AnyExtension 类型来自 [Tiptap](https://github.com/ueberdosis/tiptap),这意味着 Halo 默认编辑器的扩展点返回类型与 Tiptap 的扩展完全一致Tiptap 的扩展文档可参考:[https://tiptap.dev/docs/editor/api/extensions](https://tiptap.dev/docs/editor/api/extensions)。此外Halo 也为默认编辑器的扩展提供了一些独有的参数,用于实现工具栏、指令等扩展。
AnyExtension 类型来自 [Tiptap](https://github.com/ueberdosis/tiptap),这意味着 Halo 默认编辑器的扩展点返回类型与 Tiptap 的扩展完全一致Tiptap 的扩展文档可参考:<https://tiptap.dev/docs/editor/api/extensions>。此外Halo 也为默认编辑器的扩展提供了一些独有的参数,用于实现工具栏、指令等扩展。
:::
### Halo 独有扩展
@ -60,7 +60,7 @@ export interface ExtensionOptions {
![顶部工具栏扩展](/img/developer-guide/plugin/api-reference/ui/extension-points/default-editor-extension-toolbar.png)
[https://github.com/halo-sigs/richtext-editor/pull/16](https://github.com/halo-sigs/richtext-editor/pull/16) 中,我们实现了对顶部工具栏的扩展,如果需要添加额外的功能,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getToolbarItems` 函数即可,如:
<https://github.com/halo-sigs/richtext-editor/pull/16> 中,我们实现了对顶部工具栏的扩展,如果需要添加额外的功能,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getToolbarItems` 函数即可,如:
```ts
{
@ -130,7 +130,7 @@ addOptions() {
![工具箱扩展](/img/developer-guide/plugin/api-reference/ui/extension-points/default-editor-extension-toolbox.png)
[https://github.com/halo-sigs/richtext-editor/pull/27](https://github.com/halo-sigs/richtext-editor/pull/27) 中,我们实现了对编辑器工具箱区域的扩展,如果需要添加额外的功能,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getToolboxItems` 函数即可,如:
<https://github.com/halo-sigs/richtext-editor/pull/27> 中,我们实现了对编辑器工具箱区域的扩展,如果需要添加额外的功能,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getToolboxItems` 函数即可,如:
```ts
{
@ -201,7 +201,7 @@ Slash Command (斜杠命令)的扩展,可用于在当前行快捷执行功
![Slash Command 扩展](/img/developer-guide/plugin/api-reference/ui/extension-points/default-editor-extension-slash-command.png)
[https://github.com/halo-sigs/richtext-editor/pull/16](https://github.com/halo-sigs/richtext-editor/pull/16) 中,我们实现了对 Slash Command 指令的扩展,如果需要添加额外的功能,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getCommandMenuItems` 函数即可,如:
<https://github.com/halo-sigs/richtext-editor/pull/16> 中,我们实现了对 Slash Command 指令的扩展,如果需要添加额外的功能,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getCommandMenuItems` 函数即可,如:
```ts
{
@ -263,7 +263,7 @@ addOptions() {
![悬浮菜单扩展](/img/developer-guide/plugin/api-reference/ui/extension-points/default-editor-extension-bubble-menu.png)
[https://github.com/halo-sigs/richtext-editor/pull/38](https://github.com/halo-sigs/richtext-editor/pull/38) 中,我们重构了对编辑器悬浮区域的扩展,如果需要对某个块进行支持,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getBubbleMenu` 函数即可,如:
<https://github.com/halo-sigs/richtext-editor/pull/38> 中,我们重构了对编辑器悬浮区域的扩展,如果需要对某个块进行支持,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getBubbleMenu` 函数即可,如:
```ts
{
@ -296,7 +296,7 @@ interface BubbleMenuProps {
from?: number;
to?: number;
}) => boolean;
tippyOptions?: Record\<string, unknown\>; // 可自由定制悬浮菜单所用的 tippy 组件的选项
tippyOptions?: Record<string, unknown>; // 可自由定制悬浮菜单所用的 tippy 组件的选项
getRenderContainer?: (node: HTMLElement) => HTMLElement; // 悬浮菜单所基准的 DOM
defaultAnimation?: boolean; // 是否启用默认动画。默认为 true
}
@ -373,7 +373,7 @@ addOptions() {
![拖拽功能扩展](/img/developer-guide/plugin/api-reference/ui/extension-points/default-editor-extension-drag.png)
[https://github.com/halo-sigs/richtext-editor/pull/48](https://github.com/halo-sigs/richtext-editor/pull/48) 中,我们实现了对所有元素的拖拽功能,如果需要让当前扩展支持拖拽,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getDraggable` 函数,并让其返回 true 即可。如:
<https://github.com/halo-sigs/richtext-editor/pull/48> 中,我们实现了对所有元素的拖拽功能,如果需要让当前扩展支持拖拽,只需要在具体的 Tiptap Extension 中的 `addOptions` 中定义 `getDraggable` 函数,并让其返回 true 即可。如:
```ts
{
@ -474,6 +474,6 @@ addOptions() {
## 实现案例
- [https://github.com/halo-sigs/plugin-hybrid-edit-block](https://github.com/halo-sigs/plugin-hybrid-edit-block)
- [https://github.com/halo-sigs/plugin-katex](https://github.com/halo-sigs/plugin-katex)
- [https://github.com/halo-sigs/plugin-text-diagram](https://github.com/halo-sigs/plugin-text-diagram)
- <https://github.com/halo-sigs/plugin-hybrid-edit-block>
- <https://github.com/halo-sigs/plugin-katex>
- <https://github.com/halo-sigs/plugin-text-diagram>

@ -179,10 +179,10 @@ code {
</style>
```
> 来源:[https://vuejs.org/examples/#markdown](https://vuejs.org/examples/#markdown)
> 来源:<https://vuejs.org/examples/#markdown>
## 实现案例
- [https://github.com/halo-sigs/plugin-stackedit](https://github.com/halo-sigs/plugin-stackedit)
- [https://github.com/halo-sigs/plugin-bytemd](https://github.com/halo-sigs/plugin-bytemd)
- [https://github.com/justice2001/halo-plugin-vditor](https://github.com/justice2001/halo-plugin-vditor)
- <https://github.com/halo-sigs/plugin-stackedit>
- <https://github.com/halo-sigs/plugin-bytemd>
- <https://github.com/justice2001/halo-plugin-vditor>

@ -1,64 +0,0 @@
```ts
export interface ListedComment {
comment:{
apiVersion: "content.halo.run/v1alpha1"
kind: "Comment"
metadata: {
annotations: {}
creationTimestamp: string
labels: {}
name: string // 评论的唯一标识
version: number
}
spec: {
allowNotification: boolean; // 是否允许通知
approved: boolean;
approvedTime: string;
content: string; // 最终渲染的文本
creationTime: string; // 创建时间
hidden: boolean;
ipAddress: string; // 评论者 IP 地址
lastReadTime: string;
owner: { // 创建者信息
annotations: {};
displayName: string;
kind: string;
name: string;
};
priority: number; // 排序字段
raw: string; // 原始文本,一般用于给编辑器使用
subjectRef: { // 引用关联,比如文章、自定义页面
group: string;
kind: string;
name: string;
version: string;
};
top: boolean; // 是否置顶
userAgent: string; // 评论者 UserAgent 信息
}
status: {
hasNewReply: boolean; // 是否有新回复
lastReplyTime: string;
observedVersion: number;
replyCount: number; // 回复数量
unreadReplyCount: number;
visibleReplyCount: number;
}
}
owner: { // 创建者信息
avatar: string; // 头像
displayName: string; // 描述
email: string; // 邮箱
kind: string;
name: string; // 创建者的唯一标识
}
stats: {
upvote: number;
}
subject: {
apiVersion: string;
kind: string;
metadata: Metadata;
}
}
```

@ -1,49 +0,0 @@
```ts
export interface ListedReply {
owner: { // 创建者信息
avatar: string; // 头像
displayName: string; // 描述
email: string; // 邮箱
kind: string;
name: string; // 创建者的唯一标识
}
reply:{
apiVersion: "content.halo.run/v1alpha1"
kind: "Reply"
metadata: {
annotations: {}
creationTimestamp: string
labels: {}
name: string // 评论的唯一标识
version: number
}
spec: {
allowNotification: boolean; // 是否允许通知
approved: boolean;
approvedTime: string;
commentName: string; // 被回复的评论名称,即 Comment 的 metadata.name
content: string; // 最终渲染的文本
creationTime: string; // 创建时间
hidden: boolean;
ipAddress: string; // 评论者 IP 地址
owner: { // 创建者信息
annotations: {};
displayName: string;
kind: string;
name: string;
};
priority: number; // 排序字段
quoteReply: string; // 被回复的回复名称,即 Reply 的 metadata.name
raw: string; // 原始文本,一般用于给编辑器使用
top: boolean; // 是否置顶
userAgent: string; // 评论者 UserAgent 信息
}
status: {
observedVersion: number;
}
}
stats: {
upvote: number;
}
}
```

@ -2,7 +2,7 @@
export interface OperationItem<T> {
priority: number; // 排序优先级
component: Raw<Component>; // 菜单项组件
props?: Record\<string, unknown\>; // 菜单项组件属性
props?: Record<string, unknown>; // 菜单项组件属性
action?: (item?: T) => void; // 菜单项点击事件
label?: string; // 菜单项标题
hidden?: boolean; // 菜单项是否隐藏

@ -33,7 +33,7 @@ export interface PluginInstallationTab {
id: string; // 选项卡 ID
label: string; // 选项卡标题
component: Raw<Component>; // 选项卡面板组件
props?: Record\<string, unknown\>; // 选项卡面板组件属性
props?: Record<string, unknown>; // 选项卡面板组件属性
permissions?: string[]; // 选项卡 UI 权限
priority: number; // 选项卡排序优先级
}
@ -41,4 +41,4 @@ export interface PluginInstallationTab {
## 实现案例
- [https://github.com/halo-dev/plugin-app-store](https://github.com/halo-dev/plugin-app-store)
- <https://github.com/halo-dev/plugin-app-store>

@ -33,7 +33,7 @@ export interface EntityFieldItem {
priority: number;
position: "start" | "end";
component: Raw<Component>;
props?: Record\<string, unknown\>;
props?: Record<string, unknown>;
permissions?: string[];
hidden?: boolean;
}
@ -71,7 +71,7 @@ export default definePlugin({
## 实现案例
- [https://github.com/halo-dev/plugin-app-store](https://github.com/halo-dev/plugin-app-store)
- <https://github.com/halo-dev/plugin-app-store>
## 类型定义

@ -42,7 +42,7 @@ import OperationItem from "./interface/OperationItem.md";
## 实现案例
- [https://github.com/halo-dev/plugin-app-store](https://github.com/halo-dev/plugin-app-store)
- <https://github.com/halo-dev/plugin-app-store>
## 类型定义

@ -37,7 +37,7 @@ export interface PluginTab {
其中,`component` 组件可以注入inject以下属性
- `plugin`:当前插件对象,类型为 Ref\<[Plugin](#plugin)\>。
- `plugin`:当前插件对象,类型为 Ref<[Plugin](#plugin)>。
## 示例
@ -77,7 +77,7 @@ const plugin = inject<Ref<Plugin | undefined>>("plugin");
## 实现案例
- [https://github.com/halo-dev/plugin-app-store](https://github.com/halo-dev/plugin-app-store)
- <https://github.com/halo-dev/plugin-app-store>
## 类型定义

@ -33,7 +33,7 @@ export interface EntityFieldItem {
priority: number;
position: "start" | "end";
component: Raw<Component>;
props?: Record\<string, unknown\>;
props?: Record<string, unknown>;
permissions?: string[];
hidden?: boolean;
}

@ -1,81 +0,0 @@
---
title: 回复数据列表操作菜单
description: 扩展回复数据列表操作菜单 - reply:list-item:operation:create
---
此扩展点用于扩展回复数据列表的操作菜单项。
![回复数据列表操作菜单](/img/developer-guide/plugin/api-reference/ui/extension-points/reply-list-item-operation-create.png)
## 定义方式
```ts
export default definePlugin({
extensionPoints: {
"reply:list-item:operation:create": (
reply: Ref<ListedReply>
): OperationItem<ListedReply>[] | Promise<OperationItem<ListedReply>[]> => {
return [
{
priority: 10,
component: markRaw(VDropdownItem),
props: {},
action: (item?: ListedReply) => {
// do something
},
label: "foo",
hidden: false,
permissions: [],
children: [],
},
];
},
},
});
```
```mdx-code-block
import OperationItem from "./interface/OperationItem.md";
<OperationItem />
```
## 示例
此示例将实现一个操作菜单项。
```ts
import type { ListedReply } from "@halo-dev/api-client";
import { VDropdownItem } from "@halo-dev/components";
import { definePlugin } from "@halo-dev/console-shared";
import { markRaw } from "vue";
export default definePlugin({
extensionPoints: {
"reply:list-item:operation:create": () => {
return [
{
priority: 21,
component: markRaw(VDropdownItem),
label: "测试回复菜单",
visible: true,
permissions: [],
action: async (reply: ListedReply) => {
console.log(reply)
},
},
];
},
},
});
```
## 类型定义
### ListedReply
```mdx-code-block
import ListedReply from "./interface/ListedReply.md";
<ListedReply />
```

@ -78,7 +78,7 @@ export default definePlugin({
## 实现案例
- [https://github.com/halo-dev/plugin-app-store](https://github.com/halo-dev/plugin-app-store)
- <https://github.com/halo-dev/plugin-app-store>
## 类型定义

@ -33,7 +33,7 @@ export interface ThemeListTab {
id: string; // 选项卡 ID
label: string; // 选项卡标题
component: Raw<Component>; // 选项卡面板组件
props?: Record\<string, unknown\>; // 选项卡面板组件属性
props?: Record<string, unknown>; // 选项卡面板组件属性
permissions?: string[]; // 选项卡 UI 权限
priority: number; // 选项卡排序优先级
}
@ -41,4 +41,4 @@ export interface ThemeListTab {
## 实现案例
- [https://github.com/halo-dev/plugin-app-store](https://github.com/halo-dev/plugin-app-store)
- <https://github.com/halo-dev/plugin-app-store>

@ -56,7 +56,7 @@ spec:
- `spec.issues`:插件问题反馈地址,如果你的插件是开源在 GitHub 上,可以直接配置为 GitHub Issues 地址。
- `spec.displayName`:插件的显示名称,它通常是以少数几个字来概括插件的用途。
- `spec.description`:插件描述,用一段简短的说明来介绍插件的用途。
- `spec.license`:插件使用的软件协议,参考:[https://en.wikipedia.org/wiki/Software_license](https://en.wikipedia.org/wiki/Software_license)
- `spec.license`:插件使用的软件协议,参考:<https://en.wikipedia.org/wiki/Software_license>
Halo 的插件可以在两种模式下运行:`development` 和 `deployment`
`deployment`(默认)模式是插件创建的标准工作流程:为每个插件创建一个新的 Gradle 项目,编码插件(声明新的扩展点和/或添加新的扩展),将插件打包成一个 JAR 文件,部署 JAR 文件到 Halo。

@ -53,7 +53,7 @@ description: 了解插件项目的文件结构
- `resources` 下的 `plugin.yaml` 为插件的资源描述文件,它是必须的,它描述了插件的基本信息,包括插件的名称、版本、作者、描述、依赖等。
- `resources/console` 下的两个文件 `main.js``style.css` 是前端插件部分打包时输出的产物。一个插件可以没有前端部分,因此 `resources/console` 同样可以不存在。
:::warning 注意
:::caution 注意
从 2.11 开始Halo 支持了 UC 个人中心,且个人中心和 Console 的插件机制共享,所以为了避免歧义,`resources/console` 在后续版本会被重命名为 `resources/ui`,但同时也会兼容 `resources/console`
:::

@ -79,7 +79,7 @@ spec:
为了方便主题开发者从 1.x 迁移,我们提供了工具用于迁移配置文件。
工具仓库地址:[https://github.com/halo-sigs/convert-theme-config-to-next](https://github.com/halo-sigs/convert-theme-config-to-next)
工具仓库地址:<https://github.com/halo-sigs/convert-theme-config-to-next>
```bash
# 1.x 版本主题

@ -48,7 +48,7 @@ categoryFinder.getByNames(names)
### 返回值
List\<[#CategoryVo](#categoryvo)\>
List<[#CategoryVo](#categoryvo)>
### 示例
@ -75,7 +75,7 @@ categoryFinder.list(page,size)
### 返回值
[#ListResult\<CategoryVo\>](#listresultcategoryvo)
[#ListResult<CategoryVo\>](#listresultcategoryvo)
### 示例
@ -103,7 +103,7 @@ categoryFinder.listAll()
### 返回值
List\<[#CategoryVo](#categoryvo)\>
List<[#CategoryVo](#categoryvo)>
### 示例
@ -131,7 +131,7 @@ categoryFinder.listAsTree()
### 返回值
List\<[#CategoryTreeVo](#categorytreevo)\>
List<[#CategoryTreeVo](#categorytreevo)>
### 示例
@ -172,7 +172,7 @@ categoryFinder.getBreadcrumbs('category-foo')
### 返回值
List\<[#CategoryVo](#categoryvo)\>
List<[#CategoryVo](#categoryvo)>
### 示例
@ -191,7 +191,7 @@ List\<[#CategoryVo](#categoryvo)\>
<CategoryVo />
### ListResult\<CategoryVo\>
### ListResult<CategoryVo\>
```json title="ListResult<CategoryVo>"
{

@ -53,7 +53,7 @@ commentFinder.list(ref,page,size)
### 返回值
[#ListResult\<CommentVo\>](#listresultcommentvo)
[#ListResult<CommentVo\>](#listresultcommentvo)
### 示例
@ -84,7 +84,7 @@ commentFinder.listReply(commentName,page,size)
### 返回值
[#ListResult\<ReplyVo\>](#listresultreplyvo)
[#ListResult<ReplyVo\>](#listresultreplyvo)
### 示例
@ -103,7 +103,7 @@ commentFinder.listReply(commentName,page,size)
<CommentVo />
### ListResult\<CommentVo\>
### ListResult<CommentVo\>
```json title="ListResult<CommentVo>"
{
@ -125,7 +125,7 @@ commentFinder.listReply(commentName,page,size)
<ReplyVo />
### ListResult\<ReplyVo\>
### ListResult<ReplyVo\>
```json title="ListResult<ReplyVo>"
{

@ -47,7 +47,7 @@ contributorFinder.getContributors(names)
### 返回值
List\<[#ContributorVo](#contributorvo)\>
List<[#ContributorVo](#contributorvo)>
### 示例

@ -115,7 +115,7 @@ postFinder.listAll();
### 返回值
List\<[#ListedPostVo](#listedpostvo)\>
List<[#ListedPostVo](#listedpostvo)>
### 示例
@ -144,7 +144,7 @@ postFinder.list(page, size);
### 返回值
[#ListResult\<ListedPostVo\>](#listresultlistedpostvo)
[#ListResult<ListedPostVo\>](#listresultlistedpostvo)
### 示例
@ -174,7 +174,7 @@ postFinder.listByCategory(page, size, categoryName);
### 返回值
[#ListResult\<ListedPostVo\>](#listresultlistedpostvo)
[#ListResult<ListedPostVo\>](#listresultlistedpostvo)
### 示例
@ -204,7 +204,7 @@ postFinder.listByTag(page, size, tag);
### 返回值
[#ListResult\<ListedPostVo\>](#listresultlistedpostvo)
[#ListResult<ListedPostVo\>](#listresultlistedpostvo)
### 示例
@ -216,36 +216,6 @@ postFinder.listByTag(page, size, tag);
</ul>
```
## listByOwner(page,size,owner)
```js
postFinder.listByOwner(page, size, owner);
```
### 描述
根据创建者用户名和分页参数获取文章列表。
### 参数
1. `page:int` - 分页页码,从 1 开始
2. `size:int` - 分页条数
3. `owner:string` - 创建者用户名 `name`
### 返回值
[#ListResult\<ListedPostVo\>](#listresultlistedpostvo)
### 示例
```html
<ul th:with="posts = ${postFinder.listByOwner(1,10,'admin')}">
<li th:each="post : ${posts.items}">
<a th:href="@{${post.status.permalink}}" th:text="${post.spec.title}"></a>
</li>
</ul>
```
## archives(page,size)
```js
@ -263,7 +233,7 @@ postFinder.archives(page, size);
### 返回值
[#ListResult\<PostArchiveVo\>](#listresultpostarchivevo)
[#ListResult<PostArchiveVo\>](#listresultpostarchivevo)
### 示例
@ -301,7 +271,7 @@ postFinder.archives(page, size, year);
### 返回值
[#ListResult\<PostArchiveVo\>](#listresultpostarchivevo)
[#ListResult<PostArchiveVo\>](#listresultpostarchivevo)
### 示例
@ -340,7 +310,7 @@ postFinder.archives(page, size, year, month);
### 返回值
[#ListResult\<PostArchiveVo\>](#listresultpostarchivevo)
[#ListResult<PostArchiveVo\>](#listresultpostarchivevo)
### 示例
@ -401,13 +371,13 @@ postFinder.archives(page, size, year, month);
### ListedPostVo
\<ListedPostVo \/\>
<ListedPostVo />
- [#CategoryVo](#categoryvo)
- [#TagVo](#tagvo)
- [#ContributorVo](#contributorvo)
### ListResult\<ListedPostVo\>
### ListResult<ListedPostVo\>
```json title="ListResult<ListedPostVo>"
{
@ -441,7 +411,7 @@ postFinder.archives(page, size, year, month);
- [#ListedPostVo](#listedpostvo)
### ListResult\<PostArchiveVo\>
### ListResult<PostArchiveVo\>
```json title="ListResult<PostArchiveVo>"
{

@ -77,7 +77,7 @@ singlePageFinder.list(page,size)
### 返回值
[#ListResult\<ListedSinglePageVo\>](#listresultlistedsinglepagevo)
[#ListResult<ListedSinglePageVo\>](#listresultlistedsinglepagevo)
### 示例
@ -104,7 +104,7 @@ singlePageFinder.list(page,size)
<ListedSinglePageVo />
### ListResult\<ListedSinglePageVo\>
### ListResult<ListedSinglePageVo\>
```json title="ListResult<ListedSinglePageVo>"
{

@ -47,7 +47,7 @@ tagFinder.getByNames(names)
### 返回值
List\<[#TagVo](#tagvo)\>
List<[#TagVo](#tagvo)>
### 示例
@ -74,7 +74,7 @@ tagFinder.list(page,size)
### 返回值
[#ListResult\<TagVo\>](#listresulttagvo)
[#ListResult<TagVo\>](#listresulttagvo)
### 示例
@ -102,7 +102,7 @@ tagFinder.listAll()
### 返回值
List\<[#TagVo](#tagvo)\>
List<[#TagVo](#tagvo)>
### 示例
@ -120,7 +120,7 @@ List\<[#TagVo](#tagvo)\>
<TagVo />
### ListResult\<TagVo\>
### ListResult<TagVo\>
```json title="ListResult<TagVo>"
{

@ -123,7 +123,7 @@ Setting 资源的 `metadata.name` 必须和 `theme.yaml` 中的 `spec.settingNam
为了方便主题开发者从 1.x 迁移,我们提供了工具用于迁移设置表单配置文件。
工具仓库地址:[https://github.com/halo-sigs/convert-theme-config-to-next](https://github.com/halo-sigs/convert-theme-config-to-next)
工具仓库地址:<https://github.com/halo-sigs/convert-theme-config-to-next>
```bash
# 1.x 版本主题

@ -22,7 +22,7 @@ import ListedPostVo from "../vo/_ListedPostVo.md";
#### 变量类型
[#UrlContextListResult\<PostArchiveVo\>](#urlcontextlistresultpostarchivevo)
[#UrlContextListResult<PostArchiveVo\>](#urlcontextlistresultpostarchivevo)
#### 示例
@ -65,7 +65,7 @@ import ListedPostVo from "../vo/_ListedPostVo.md";
### ListedPostVo
\<ListedPostVo \/\>
<ListedPostVo />
- [#CategoryVo](#categoryvo)
- [#TagVo](#tagvo)
@ -87,7 +87,7 @@ import ListedPostVo from "../vo/_ListedPostVo.md";
- [#ListedPostVo](#listedpostvo)
### UrlContextListResult\<PostArchiveVo\>
### UrlContextListResult<PostArchiveVo\>
```json title="UrlContextListResult<PostArchiveVo>"
{

@ -26,7 +26,7 @@ import ListedPostVo from "../vo/_ListedPostVo.md"
#### 变量类型
[#UrlContextListResult\<ListedPostVo\>](#urlcontextlistresultlistedpostvo)
[#UrlContextListResult<ListedPostVo\>](#urlcontextlistresultlistedpostvo)
#### 示例
@ -77,13 +77,13 @@ import ListedPostVo from "../vo/_ListedPostVo.md"
### ListedPostVo
\<ListedPostVo \/\>
<ListedPostVo />
- [#CategoryVo](#categoryvo)
- [#TagVo](#tagvo)
- [#ContributorVo](#contributorvo)
### UrlContextListResult\<ListedPostVo\>
### UrlContextListResult<ListedPostVo\>
```json title="UrlContextListResult<ListedPostVo>"
{

@ -16,7 +16,7 @@ import CategoryTreeVo from "../vo/_CategoryTreeVo.md"
#### 变量类型
List\<[#CategoryTreeVo](#categorytreevo)\>
List<[#CategoryTreeVo](#categorytreevo)>
#### 示例

@ -25,7 +25,7 @@ import ListedPostVo from "../vo/_ListedPostVo.md"
#### 变量类型
[#UrlContextListResult\<ListedPostVo\>](#urlcontextlistresultlistedpostvo)
[#UrlContextListResult<ListedPostVo\>](#urlcontextlistresultlistedpostvo)
#### 示例
@ -78,13 +78,13 @@ import ListedPostVo from "../vo/_ListedPostVo.md"
### ListedPostVo
\<ListedPostVo \/\>
<ListedPostVo />
- [#CategoryVo](#categoryvo)
- [#TagVo](#tagvo)
- [#ContributorVo](#contributorvo)
### UrlContextListResult\<ListedPostVo\>
### UrlContextListResult<ListedPostVo\>
```json title="UrlContextListResult<ListedPostVo>"
{

@ -19,7 +19,7 @@ import ListedPostVo from "../vo/_ListedPostVo.md"
#### 变量类型
[#UrlContextListResult\<ListedPostVo\>](#urlcontextlistresultlistedpostvo)
[#UrlContextListResult<ListedPostVo\>](#urlcontextlistresultlistedpostvo)
#### 示例
@ -71,13 +71,13 @@ import ListedPostVo from "../vo/_ListedPostVo.md"
### ListedPostVo
\<ListedPostVo \/\>
<ListedPostVo />
- [#CategoryVo](#categoryvo)
- [#TagVo](#tagvo)
- [#ContributorVo](#contributorvo)
### UrlContextListResult\<ListedPostVo\>
### UrlContextListResult<ListedPostVo\>
```json title="UrlContextListResult<ListedPostVo>"
{

@ -25,7 +25,7 @@ import ListedPostVo from "../vo/_ListedPostVo.md"
#### 变量类型
[#UrlContextListResult\<ListedPostVo\>](#urlcontextlistresultlistedpostvo)
[#UrlContextListResult<ListedPostVo\>](#urlcontextlistresultlistedpostvo)
#### 示例
@ -78,13 +78,13 @@ import ListedPostVo from "../vo/_ListedPostVo.md"
### ListedPostVo
\<ListedPostVo \/\>
<ListedPostVo />
- [#CategoryVo](#categoryvo)
- [#TagVo](#tagvo)
- [#ContributorVo](#contributorvo)
### UrlContextListResult\<ListedPostVo\>
### UrlContextListResult<ListedPostVo\>
```json title="UrlContextListResult<ListedPostVo>"
{

@ -16,7 +16,7 @@ import TagVo from '../vo/_TagVo.md'
#### 变量类型
List\<[#TagVo](#tagvo)\>
List<[#TagVo](#tagvo)>
#### 示例

@ -64,7 +64,7 @@ description: 使用腾讯云轻量应用服务器的应用模板部署 Halo
![添加域名](/img/install/tencent-cloud-lighthouse/domain.png)
除此之外,在绑定域名之后,还需要修改一下 Halo 的 **外部访问地址** 参数为实际的网站访问地址(如:[https://demo.halo.run](https://demo.halo.run)),否则 Halo 的部分功能或者插件可能会出现使用问题,只需要按照下图所示修改应用的参数然后点击确认即可。
除此之外,在绑定域名之后,还需要修改一下 Halo 的 **外部访问地址** 参数为实际的网站访问地址(如:<https://demo.halo.run>),否则 Halo 的部分功能或者插件可能会出现使用问题,只需要按照下图所示修改应用的参数然后点击确认即可。
![修改外部访问地址](/img/install/tencent-cloud-lighthouse/external-url.png)

@ -3,12 +3,8 @@ title: 使用 Docker Compose 部署
description: 使用 Docker Compose 部署
---
```mdx-code-block
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import DockerArgs from "./slots/_docker-args.md"
import DockerRegistryList from "./slots/_docker-registry-list.md"
```
:::info
在继续操作之前,我们推荐您先阅读[《写在前面》](../prepare.md),这可以快速帮助你了解 Halo。
@ -16,8 +12,8 @@ import DockerRegistryList from "./slots/_docker-registry-list.md"
## 环境搭建
- Docker 安装文档:[https://docs.docker.com/engine/install/](https://docs.docker.com/engine/install/)
- Docker Compose 安装文档:[https://docs.docker.com/compose/install/](https://docs.docker.com/compose/install/)
- Docker 安装文档:<https://docs.docker.com/engine/install/>
- Docker Compose 安装文档:<https://docs.docker.com/compose/install/>
:::tip
我们推荐按照 Docker 官方文档安装 Docker 和 Docker Compose因为部分 Linux 发行版软件仓库中的 Docker 版本可能过旧。
@ -39,20 +35,20 @@ import DockerRegistryList from "./slots/_docker-registry-list.md"
2. 创建 `docker-compose.yaml`
此文档提供几种场景的 Docker Compose 配置文件,请根据你的需要**选择一种**。
此文档提供两种场景的 Docker Compose 配置文件,请根据你的需要**选择一种**。
:::info
需要注意的是,此文档为了更加方便的管理配置,所有与 Halo 相关的配置都使用 Docker 容器启动参数代替,所以无需创建 application.yaml 文件。
:::
<Tabs queryString="current">
<TabItem value="halo-postgresql" label="Halo + PostgreSQL" default>
1. 创建 Halo + PostgreSQL 的实例:
```yaml {23-29,43} title="~/halo/docker-compose.yaml"
version: "3"
services:
halo:
image: registry.fit2cloud.com/halo/halo:2.18
image: registry.fit2cloud.com/halo/halo:2.17
restart: on-failure:3
depends_on:
halodb:
@ -98,17 +94,19 @@ import DockerRegistryList from "./slots/_docker-registry-list.md"
networks:
halo_network:
```
:::info
此示例的 PostgreSQL 数据库容器默认没有设置端口映射,如果需要在容器外部访问数据库,可以自行在 `halodb` 服务中添加端口映射PostgreSQL 的端口为 `5432`
:::
</TabItem>
<TabItem value="halo-mysql" label="Halo + MySQL">
2. 创建 Halo + MySQL 的实例:
```yaml {23-29,51} title="~/halo/docker-compose.yaml"
version: "3"
services:
halo:
image: registry.fit2cloud.com/halo/halo:2.18
image: registry.fit2cloud.com/halo/halo:2.17
restart: on-failure:3
depends_on:
halodb:
@ -164,9 +162,10 @@ import DockerRegistryList from "./slots/_docker-registry-list.md"
:::info
此示例的 MySQL 数据库容器默认没有设置端口映射,如果需要在容器外部访问数据库,可以自行在 `halodb` 服务中添加端口映射MySQL 的端口为 `3306`
:::
</TabItem>
<TabItem value="halo-h2" label="Halo + H2">
:::warning
3. 仅创建 Halo 实例(使用默认的 H2 数据库):
:::caution
不推荐在生产环境使用默认的 H2 数据库,这可能因为操作不当导致数据文件损坏。如果因为某些原因(如内存不足以运行独立数据库)必须要使用,建议按时[备份数据](../../user-guide/backup.md)。
:::
@ -175,7 +174,7 @@ import DockerRegistryList from "./slots/_docker-registry-list.md"
services:
halo:
image: registry.fit2cloud.com/halo/halo:2.18
image: registry.fit2cloud.com/halo/halo:2.17
restart: on-failure:3
volumes:
- ./halo2:/root/.halo2
@ -191,14 +190,15 @@ import DockerRegistryList from "./slots/_docker-registry-list.md"
# 外部访问地址,请根据实际需要修改
- --halo.external-url=http://localhost:8090/
```
</TabItem>
<TabItem value="external-db" label="使用外部数据库">
4. 仅创建 Halo 实例使用已有外部数据库MySQL 为例):
```yaml {7,12-20} title="~/halo/docker-compose.yaml"
version: "3"
services:
halo:
image: registry.fit2cloud.com/halo/halo:2.18
image: registry.fit2cloud.com/halo/halo:2.17
restart: on-failure:3
network_mode: "host"
volumes:
@ -214,8 +214,6 @@ import DockerRegistryList from "./slots/_docker-registry-list.md"
# 端口号 默认8090
- --server.port=8090
```
</TabItem>
</Tabs>
运行参数详解:
@ -249,7 +247,7 @@ import DockerRegistryList from "./slots/_docker-registry-list.md"
```yaml {3}
services:
halo:
image: registry.fit2cloud.com/halo/halo:2.18
image: registry.fit2cloud.com/halo/halo:2.17
```
```bash
@ -313,7 +311,7 @@ networks:
services:
halo:
image: registry.fit2cloud.com/halo/halo:2.18
image: registry.fit2cloud.com/halo/halo:2.17
restart: on-failure:3
volumes:
- ./halo2:/root/.halo2

@ -10,7 +10,7 @@ import DockerRegistryList from "./slots/_docker-registry-list.md"
在继续操作之前,我们推荐您先阅读[《写在前面》](../prepare),这可以快速帮助你了解 Halo。
:::
:::warning
:::caution
此文档仅提供使用默认 H2 数据库的 Docker 运行方式,主要用于体验和测试,在生产环境我们不推荐使用 H2 数据库,这可能因为操作不当导致数据文件损坏。如果因为某些原因(如内存不足以运行独立数据库)必须要使用,建议按时[备份数据](../../user-guide/backup.md)。
如果需要使用其他数据库部署,我们推荐使用 Docker Compose 部署:[使用 Docker Compose 部署](./docker-compose)
@ -18,7 +18,7 @@ import DockerRegistryList from "./slots/_docker-registry-list.md"
## 环境搭建
- Docker 安装文档:[https://docs.docker.com/engine/install/](https://docs.docker.com/engine/install/)
- Docker 安装文档:<https://docs.docker.com/engine/install/>
:::tip
我们推荐按照 Docker 官方文档安装 Docker因为部分 Linux 发行版软件仓库中的 Docker 版本可能过旧。
@ -31,7 +31,7 @@ import DockerRegistryList from "./slots/_docker-registry-list.md"
1. 创建容器
```bash
docker run -it -d --name halo -p 8090:8090 -v ~/.halo2:/root/.halo2 registry.fit2cloud.com/halo/halo:2.18
docker run -it -d --name halo -p 8090:8090 -v ~/.halo2:/root/.halo2 registry.fit2cloud.com/halo/halo:2.17
```
:::info
@ -48,7 +48,7 @@ import DockerRegistryList from "./slots/_docker-registry-list.md"
<DockerArgs />
2. 用浏览器访问 `/console` 即可进入 Halo 管理页面,首次启动会进入初始化页面。
1. 用浏览器访问 `/console` 即可进入 Halo 管理页面,首次启动会进入初始化页面。
:::tip
如果需要配置域名访问,建议先配置好反向代理以及域名解析再进行初始化。如果通过 `http://ip:端口号` 的形式无法访问,请到服务器厂商后台将运行的端口号添加到安全组,如果服务器使用了 Linux 面板,请检查此 Linux 面板是否有还有安全组配置,需要同样将端口号添加到安全组。
@ -60,7 +60,7 @@ import DockerRegistryList from "./slots/_docker-registry-list.md"
2. 拉取新版本镜像
```bash
docker pull registry.fit2cloud.com/halo/halo:2.18
docker pull registry.fit2cloud.com/halo/halo:2.17
```
3. 停止运行中的容器
@ -75,5 +75,5 @@ import DockerRegistryList from "./slots/_docker-registry-list.md"
修改版本号后,按照最初安装的方式,重新创建容器即可。
```bash
docker run -it -d --name halo -p 8090:8090 -v ~/.halo2:/root/.halo2 registry.fit2cloud.com/halo/halo:2.18
docker run -it -d --name halo -p 8090:8090 -v ~/.halo2:/root/.halo2 registry.fit2cloud.com/halo/halo:2.17
```

@ -53,13 +53,13 @@ title: 使用 JAR 文件部署
3. 下载运行包
```bash
wget https://dl.halo.run/release/halo-2.18.0.jar -O halo.jar
wget https://dl.halo.run/release/halo-2.17.0.jar -O halo.jar
```
:::info
以下是官方维护的下载地址:
1. [https://download.halo.run](https://download.halo.run)
2. [https://github.com/halo-dev/halo/releases](https://github.com/halo-dev/halo/releases)
1. <https://download.halo.run>
2. <https://github.com/halo-dev/halo/releases>
:::
4. 创建 [工作目录](../prepare#工作目录)
@ -132,7 +132,7 @@ title: 使用 JAR 文件部署
- DATABASE数据库名称`halo`,需要提前创建
:::
:::warning
:::caution
不推荐在生产环境使用默认的 H2 数据库,这可能因为操作不当导致数据文件损坏。如果因为某些原因(如内存不足以运行独立数据库)必须要使用,建议按时[备份数据](../../user-guide/backup.md)。
:::
@ -244,7 +244,7 @@ journalctl -n 20 -u halo
3. 下载新版本的 Halo 运行包,覆盖原有的运行包
```bash
wget https://dl.halo.run/release/halo-2.18.0.jar -O /home/halo/app/halo.jar
wget https://dl.halo.run/release/halo-2.17.0.jar -O /home/halo/app/halo.jar
```
4. 启动 Halo 服务

@ -25,7 +25,7 @@ Nginx Proxy Manager 后台还可以一键申请 SSL 证书,并且会自动续
> 说明:默认你的服务器已经安装了 Docker 和 Docker Compose如果你没有安装可以参考[使用 Docker Compose 部署](../docker-compose) 的环境搭建部分来进行安装。
点击下方链接进入 Nginx Proxy Manager以下简称 NPM 官网:[https://nginxproxymanager.com/](https://nginxproxymanager.com/)
点击下方链接进入 Nginx Proxy Manager以下简称 NPM 官网:<https://nginxproxymanager.com/>
我们可以直接选择 [快速安装](https://nginxproxymanager.com/guide/#quick-setup)。

@ -26,7 +26,7 @@ description: 使用 Traefik 管理 Halo 服务的反向代理
3. 开启 Traefik Dashboard建议使用二级域名的形式示例`traefik.yourdomain.com`)。[文档](https://doc.traefik.io/traefik/operations/dashboard/#dashboard-router-rule)
4. 开启证书自动生成,通过 ACME 自动管理 TLS 证书的申请、校验与续期。[文档](https://doc.traefik.io/traefik/https/acme/)
:::warning
:::caution
ACME 证书 (`/acme.json`) 一定要 [持久化](https://doc.traefik.io/traefik/https/acme/#storage),否则每次重启 Traefik 服务,都会去申请签发证书。可能会触发 Let's
Encrypt 的 [速率限制](https://letsencrypt.org/zh-cn/docs/rate-limits/),导致签名的域名一段时间内无法签发新的证书。
:::
@ -96,7 +96,7 @@ networks:
services:
halo:
image: registry.fit2cloud.com/halo/halo:2.18
image: registry.fit2cloud.com/halo/halo:2.17
container_name: halo
restart: on-failure:3
volumes:

@ -37,7 +37,7 @@ Podman 采用无守护进程的包容性架构,因此可以更安全、更简
## 环境搭建
- Podman 安装文档:[https://podman.io/docs/installation](https://podman.io/docs/installation)
- Podman 安装文档:<https://podman.io/docs/installation>
:::tip
我们推荐您先阅读 Podman 官方文档对 Podman 有了相关了解后再考虑通过Linux包管理系统安装 Podman 或者使用文档中指定的方式安装 。
@ -57,7 +57,7 @@ Podman 采用无守护进程的包容性架构,因此可以更安全、更简
```bash
mkdir -p ~/.halo2
podman run -it -d --name halo -p 8090:8090 -v ~/.halo2:/root/.halo2 registry.fit2cloud.com/halo/halo:2.18
podman run -it -d --name halo -p 8090:8090 -v ~/.halo2:/root/.halo2 registry.fit2cloud.com/halo/halo:2.17
```
:::info
@ -74,7 +74,7 @@ Podman 采用无守护进程的包容性架构,因此可以更安全、更简
<DockerArgs />
2. 用浏览器访问 `/console` 即可进入 Halo 管理页面,首次启动会进入初始化页面。
1. 用浏览器访问 `/console` 即可进入 Halo 管理页面,首次启动会进入初始化页面。
:::tip
如果需要配置域名访问,建议先配置好反向代理以及域名解析再进行初始化。如果通过 `http://ip:端口号` 的形式无法访问,请到服务器厂商后台将运行的端口号添加到安全组,如果服务器使用了 Linux 面板,请检查此 Linux 面板是否有还有安全组配置,需要同样将端口号添加到安全组。
@ -86,7 +86,7 @@ Podman 采用无守护进程的包容性架构,因此可以更安全、更简
2. 拉取新版本镜像
```bash
podman pull registry.fit2cloud.com/halo/halo:2.18
podman pull registry.fit2cloud.com/halo/halo:2.17
```
3. 停止运行中的容器
@ -101,7 +101,7 @@ Podman 采用无守护进程的包容性架构,因此可以更安全、更简
修改版本号后,按照最初安装的方式,重新创建容器即可。
```bash
podman run -it -d --name halo -p 8090:8090 -v ~/.halo2:/root/.halo2 registry.fit2cloud.com/halo/halo:2.18
podman run -it -d --name halo -p 8090:8090 -v ~/.halo2:/root/.halo2 registry.fit2cloud.com/halo/halo:2.17
```
## 使用 [Podman Quadlet](https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html)
@ -137,7 +137,7 @@ Environment=SPRING_CONFIG_LOCATION="optional:classpath:/;optional:file:/.halo/"
Environment=TZ=Asia/Shanghai
Volume=/opt/podman-data/halo:/.halo
PublishPort=127.0.0.1:8090:8090
Image=ghcr.io/halo-dev/halo:2.18
Image=ghcr.io/halo-dev/halo:2.17
Exec=--halo.external-url=https://localhost:8090 --spring.sql.init.platform=postgresql --spring.r2dbc.url=r2dbc:pool:postgresql://127.0.0.1:5432/my-db --spring.r2dbc.username=my-user --spring.r2dbc.password=my-password
[Service]
@ -166,7 +166,7 @@ Podman Quadlet 解析:
`[Container]` 部分:
- `AutoUpdate=registry`指定了自动拉取容器。假设后续Halo镜像支持了`latest`标签,你需要`systemctl enable --now podman-auto-update.timer`以启用容器自动更新。本文示例`ghcr.io/halo-dev/halo:2.18`,将会自动更新适用与`2.18`版本的patch例如您创建容器时是`2.18.1`,在官方发布`2.18.2`版本时,容器会自动更新到`2.18.2`。
- `AutoUpdate=registry`指定了自动拉取容器。假设后续Halo镜像支持了`latest`标签,你需要`systemctl enable --now podman-auto-update.timer`以启用容器自动更新。本文示例`ghcr.io/halo-dev/halo:2.17`,将会自动更新适用与`2.17`版本的patch例如您创建容器时是`2.17.1`,在官方发布`2.17.2`版本时,容器会自动更新到`2.17.2`。
- `ContainerName=`指定了 systemd 将生成的服务名称。
- `User=60000 Group=60000 UserNS=keep-id:uid=60000,gid=60000` 限制容器以 id 60000 的用户运行提高安全性。注意这个id 60000请根据你实际想要运行的用户名来修改可通过`id user`获得你的用户的id.
- `Environment=`字段指定了容器的环境变量,其中你需要注意的是`Environment=HALO_WORK_DIR="/.halo"` `Environment=SPRING_CONFIG_LOCATION="optional:classpath:/;optional:file:/.halo/"`这两个变量中的`/.halo`路径。
@ -209,7 +209,7 @@ AutoUpdate=registry
ContainerName=halo
Volume=/opt/podman-data/halo:/root/.halo
PublishPort=127.0.0.1:8090:8090
Image=ghcr.io/halo-dev/halo:2.18
Image=ghcr.io/halo-dev/halo:2.17
Exec=--halo.external-url=https://localhost:8090 --spring.sql.init.platform=postgresql --spring.r2dbc.url=r2dbc:pool:postgresql://127.0.0.1:5432/my-db --spring.r2dbc.username=my-user --spring.r2dbc.password=my-password
[Service]

@ -3,7 +3,7 @@
| `spring.r2dbc.url` | 数据库连接地址,详细可查阅下方的 `数据库配置` |
| `spring.r2dbc.username` | 数据库用户名 |
| `spring.r2dbc.password` | 数据库密码 |
| `spring.sql.init.platform` | 数据库平台名称,支持 `postgresql`、`mysql`、`mariadb`、`h2` |
| `spring.sql.init.platform` | 数据库平台名称,支持 `postgresql`、`mysql`、`h2` |
| `halo.external-url` | 外部访问链接,如果需要在公网访问,需要配置为实际访问地址 |
数据库配置:

@ -5,11 +5,11 @@
- [ghcr.io/halo-dev/halo](https://github.com/halo-dev/halo/pkgs/container/halo)
:::info 注意
目前 Halo 2 并未更新 Docker 的 latest 标签镜像,主要因为 Halo 2 不兼容 1.x 版本,防止使用者误操作。我们推荐使用固定版本的标签,比如 `2.18` 或者 `2.18.0`。
目前 Halo 2 并未更新 Docker 的 latest 标签镜像,主要因为 Halo 2 不兼容 1.x 版本,防止使用者误操作。我们推荐使用固定版本的标签,比如 `2.17` 或者 `2.17.0`。
- `registry.fit2cloud.com/halo/halo:2`:表示最新的 2.x 版本,即每次发布新版本都会更新此镜像。
- `registry.fit2cloud.com/halo/halo:2.18`:表示最新的 2.18.x 版本,即每次发布 patch 版本都会同时更新此镜像。
- `registry.fit2cloud.com/halo/halo:2.18.0`:表示一个具体的版本。
- `registry.fit2cloud.com/halo/halo:2.17`:表示最新的 2.17.x 版本,即每次发布 patch 版本都会同时更新此镜像。
- `registry.fit2cloud.com/halo/halo:2.17.0`:表示一个具体的版本。
后续文档以 `registry.fit2cloud.com/halo/halo:2.18` 为例。
后续文档以 `registry.fit2cloud.com/halo/halo:2.17` 为例。
:::

@ -8,21 +8,21 @@ description: 从 Halo 1.x 迁移的完整指南和注意事项
- Halo 版本必须为 1.5.x 或 1.6.x。如果不满足需要先升级到 1.5.x 或 1.6.x 版本。
- Halo 2.0 不兼容 1.x 的主题,建议在升级前先查询你正在使用的主题是否已经支持 2.0。你可以访问 [halo-sigs/awesome-halo](https://github.com/halo-sigs/awesome-halo) 或 [应用市场](https://halo.run/store/apps?type=THEME) 查阅目前支持的主题。
- Halo 2.0 目前没有内置 Markdown 编辑器,如果需要重新编辑迁移后的文章,需要额外安装 Markdown 编辑器插件。目前社区已经提供了以下插件:
- StackEdit[https://halo.run/store/apps/app-hDXMG](https://halo.run/store/apps/app-hDXMG)
- ByteMD[https://halo.run/store/apps/app-HTyhC](https://halo.run/store/apps/app-HTyhC)
- StackEdit<https://halo.run/store/apps/app-hDXMG>
- ByteMD<https://halo.run/store/apps/app-HTyhC>
- Halo 2.0 不再内置友情链接、日志、图库等模块,需要安装额外的插件,目前官方已提供:
- 链接管理:[https://halo.run/store/apps/app-hfbQg](https://halo.run/store/apps/app-hfbQg)
- 图库:[https://halo.run/store/apps/app-BmQJW](https://halo.run/store/apps/app-BmQJW)
- 瞬间(原日志):[https://halo.run/store/apps/app-SnwWD](https://halo.run/store/apps/app-SnwWD)
- 链接管理:<https://halo.run/store/apps/app-hfbQg>
- 图库:<https://halo.run/store/apps/app-BmQJW>
- 瞬间(原日志):<https://halo.run/store/apps/app-SnwWD>
- Halo 2.0 不再内置外部云存储的支持。需要安装额外的插件,目前官方已提供:
- S3兼容国内主流的云存储[https://halo.run/store/apps/app-Qxhpp](https://halo.run/store/apps/app-Qxhpp)
- 阿里云 OSS[https://halo.run/store/apps/app-wCJCD](https://halo.run/store/apps/app-wCJCD)
- S3兼容国内主流的云存储<https://halo.run/store/apps/app-Qxhpp>
- 阿里云 OSS<https://halo.run/store/apps/app-wCJCD>
- 在迁移过程中不会保留旧版本的用户数据,迁移完成之后,关于文章等数据的关联都将改为 Halo 2.0 的新用户。
- 为了防止直接升级 2.0 导致 1.x 的数据受到破坏,我们已经将工作目录由 `~/.halo` 变更为 `~/.halo2`
- 目前 Halo 2.0 仅提供 Docker 部署方式,没有提供可执行 JAR 包,但可以自编译,请参考 [构建](../developer-guide/core/build.md) 文档
- 可以考虑先在本地运行一个 Halo 2.0,模拟一下导入,检查导入后是否满足要求。
如果遇到了迁移过程中的问题,也可以向我们提交 Issue: [https://github.com/halo-dev/halo/issues/new/choose](https://github.com/halo-dev/halo/issues/new/choose),以上暂不支持的功能我们也会陆续完善。
如果遇到了迁移过程中的问题,也可以向我们提交 Issue: <https://github.com/halo-dev/halo/issues/new/choose>,以上暂不支持的功能我们也会陆续完善。
## 备份数据
@ -54,11 +54,11 @@ description: 从 Halo 1.x 迁移的完整指南和注意事项
在迁移过程中,需要提前安装必要的插件:
- 站点迁移:[https://halo.run/store/apps/app-TlUBt](https://halo.run/store/apps/app-TlUBt)
- 链接管理:[https://halo.run/store/apps/app-hfbQg](https://halo.run/store/apps/app-hfbQg)
- 图库:[https://halo.run/store/apps/app-BmQJW](https://halo.run/store/apps/app-BmQJW)
- 瞬间(原日志):[https://halo.run/store/apps/app-SnwWD](https://halo.run/store/apps/app-SnwWD)
- S3如果需要迁移存在云存储的附件需要安装[https://halo.run/store/apps/app-Qxhpp](https://halo.run/store/apps/app-Qxhpp)
- 站点迁移:<https://halo.run/store/apps/app-TlUBt>
- 链接管理:<https://halo.run/store/apps/app-hfbQg>
- 图库:<https://halo.run/store/apps/app-BmQJW>
- 瞬间(原日志):<https://halo.run/store/apps/app-SnwWD>
- S3如果需要迁移存在云存储的附件需要安装<https://halo.run/store/apps/app-Qxhpp>
## 配置存储策略

@ -63,7 +63,7 @@ Halo 目前支持以下数据库:
其中H2 不需要单独运行,其他数据库需要单独安装并配置。一般情况下,推荐按照 [使用 Docker Compose 部署](./install/docker-compose.md) 文档将 Halo 和数据库容器编排在一起。
:::warning
:::caution
不推荐在生产环境使用默认的 H2 数据库,这可能因为操作不当导致数据文件损坏。如果因为某些原因(如内存不足以运行独立数据库)必须要使用,建议按时[备份数据](../user-guide/backup.md)。
:::

@ -34,15 +34,15 @@ slug: /
## 快速开始
```bash
docker run -d --name halo -p 8090:8090 -v ~/.halo2:/root/.halo2 halohub/halo:2.18
docker run -d --name halo -p 8090:8090 -v ~/.halo2:/root/.halo2 halohub/halo:2.17
```
以上仅作为体验使用,详细部署文档请查阅:[https://docs.halo.run/getting-started/install/docker-compose](https://docs.halo.run/getting-started/install/docker-compose)
以上仅作为体验使用,详细部署文档请查阅:<https://docs.halo.run/getting-started/install/docker-compose>
## 在线体验
- 环境地址:[https://demo.halo.run](https://demo.halo.run)
- 后台地址:[https://demo.halo.run/console](https://demo.halo.run/console)
- 环境地址:<https://demo.halo.run>
- 后台地址:<https://demo.halo.run/console>
- 用户名:`demo`
- 密码:`P@ssw0rd123..`
@ -59,10 +59,10 @@ Halo 使用 GPL-v3.0 协议开源,请遵守开源协议。
## 赞助
如果 Halo 对你有帮助,欢迎[赞助我们](https://afdian.com/a/halo-dev),感谢以下赞助者对 Halo 项目的支持:
如果 Halo 对你有帮助,欢迎[赞助我们](https://afdian.net/a/halo-dev),感谢以下赞助者对 Halo 项目的支持:
<p align="center">
<a target="_blank" href="https://afdian.com/a/halo-dev">
<a target="_blank" href="https://afdian.net/a/halo-dev">
<img alt="sponsors" src="https://github.com/halo-sigs/sponsor-images/blob/main/sponsorkit/sponsors.svg?raw=true" />
</a>
</p>

@ -5,7 +5,7 @@ description: 内置应用市场的使用说明
为了方便使用者安装应用市场的主题和插件,我们提供了一个内置到 Console 的应用市场插件,可以更加方便在 Console 直接安装主题和插件。并且此插件从 Halo 2.10 开始已经预设到 Halo 中,无需手动安装。
如果你使用了旧版本的 Halo并且当前未安装应用市场插件可以访问 [https://www.halo.run/store/apps/app-VYJbF](https://www.halo.run/store/apps/app-VYJbF) 手动下载并在 Console 的插件管理中安装。
如果你使用了旧版本的 Halo并且当前未安装应用市场插件可以访问 <https://www.halo.run/store/apps/app-VYJbF> 手动下载并在 Console 的插件管理中安装。
:::info 提示
这是目前唯一由 Halo 官方提供的服务,如果你当前的 Halo 网站处于无法访问外网的环境或者不需要此功能,你可以卸载或者停用此插件,不会影响网站的正常使用。
@ -13,7 +13,7 @@ description: 内置应用市场的使用说明
## 应用市场页面
这是一个为 Console 提供的独立的应用市场页面,此页面基本和 [https://www.halo.run/store/apps](https://www.halo.run/store/apps) 保持一致,但有所不同的是,你可以直接在这里查看所有的主题和插件并安装到你的 Halo 站点中。
这是一个为 Console 提供的独立的应用市场页面,此页面基本和 <https://www.halo.run/store/apps> 保持一致,但有所不同的是,你可以直接在这里查看所有的主题和插件并安装到你的 Halo 站点中。
![应用市场](/img/user-guide/app-store/app-store-page.png)
@ -51,7 +51,7 @@ description: 内置应用市场的使用说明
目前部分付费主题和插件需要许可证激活才能够正常使用,在购买付费应用之后就会自动为你的 Halo 官网账号中生成对应的应用许可证,**所以在此之前需要确保已经在你的网站中绑定好了 Halo 官网账号**。
:::info 注意
当前应用市场的许可证暂不支持离线激活,需要 Halo 所在的服务器能够正常访问 [https://www.halo.run](https://www.halo.run)
当前应用市场的许可证暂不支持离线激活,需要 Halo 所在的服务器能够正常访问 <https://www.halo.run>
:::
在安装好需要许可证的付费插件或主题后,列表会显示一个许可证状态的图标,点击即可打开许可证激活的对话框,选择许可证并点击激活即可。

@ -12,8 +12,8 @@ Halo 默认提供了本地的存储策略类型,你还可以通过安装插件
:::info
目前 Halo 官方维护了两个存储策略插件,可以根据需要选择安装:
1. 阿里云 OSS[https://halo.run/store/apps/app-wCJCD](https://halo.run/store/apps/app-wCJCD)
2. Amazon S3 协议(主流云存储厂商均支持):[https://halo.run/store/apps/app-Qxhpp](https://halo.run/store/apps/app-Qxhpp)
1. 阿里云 OSS<https://halo.run/store/apps/app-wCJCD>
2. Amazon S3 协议(主流云存储厂商均支持):<https://halo.run/store/apps/app-Qxhpp>
:::
你可以点击附件页面右上角的 `存储策略` 按钮对存储策略进行管理。

@ -62,6 +62,6 @@ Halo 作为一款好用又强大的开源建站工具,配合上不同的模板
:::info
目前有两个官方渠道可以获取主题和插件:
- 应用市场:[https://halo.run/store/apps](https://halo.run/store/apps)
- Awesome Halo[https://github.com/halo-sigs/awesome-halo](https://github.com/halo-sigs/awesome-halo)
- 应用市场:<https://halo.run/store/apps>
- Awesome Halo<https://github.com/halo-sigs/awesome-halo>
:::

@ -93,7 +93,7 @@ server {
--name halo-1 \
-p 8090:8090 \
-v ~/.halo2:/root/.halo2 \
registry.fit2cloud.com/halo/halo:2.18 \
registry.fit2cloud.com/halo/halo:2.17 \
# 第二个 Halo 容器
docker run \
@ -101,7 +101,7 @@ server {
--name halo-2 \
-p 8091:8090 \
-v ~/.halo2_2:/root/.halo2 \
registry.fit2cloud.com/halo/halo:2.18 \
registry.fit2cloud.com/halo/halo:2.17 \
```
更多 Docker 相关的教程请参考:[使用 Docker 部署 Halo](../getting-started/install/docker.md)

@ -10,8 +10,8 @@ description: 插件管理相关功能说明
:::info
目前有两个官方渠道可以获取插件:
- 应用市场:[https://www.halo.run/store/apps](https://www.halo.run/store/apps)
- Awesome Halo[https://github.com/halo-sigs/awesome-halo](https://github.com/halo-sigs/awesome-halo)
- 应用市场:<https://www.halo.run/store/apps>
- Awesome Halo<https://github.com/halo-sigs/awesome-halo>
:::

@ -21,8 +21,8 @@ description: 文章管理相关功能说明
:::info
Halo 支持通过插件来拓展文章编辑器,目前 Halo 官方维护了另外两款编辑器插件,可以按需安装使用:
1. StackEdit[https://halo.run/store/apps/app-hDXMG](https://halo.run/store/apps/app-hDXMG)
2. ByteMD[https://halo.run/store/apps/app-HTyhC](https://halo.run/store/apps/app-HTyhC)
1. StackEdit<https://halo.run/store/apps/app-hDXMG>
2. ByteMD<https://halo.run/store/apps/app-HTyhC>
:::
## 文章设置

@ -8,8 +8,8 @@ description: 主题管理相关功能说明
:::info
目前有两个官方渠道可以获取主题:
- 应用市场:[https://www.halo.run/store/apps](https://www.halo.run/store/apps)
- Awesome Halo[https://github.com/halo-sigs/awesome-halo](https://github.com/halo-sigs/awesome-halo)
- 应用市场:<https://www.halo.run/store/apps>
- Awesome Halo<https://github.com/halo-sigs/awesome-halo>
:::

@ -104,7 +104,7 @@ Halo 提供了全新创建和基于已有角色创建两种角色创建方式。
:::info
目前 Halo 官方提供的身份认证插件:
- OAuth2 认证:[https://halo.run/store/apps/app-ESVDK](https://halo.run/store/apps/app-ESVDK)
- OAuth2 认证:<https://halo.run/store/apps/app-ESVDK>
:::
你可以在用户管理界面的右上角点击 `身份认证` 按钮,进入身份认证管理页面。

@ -1,6 +1,5 @@
const darkCodeTheme = require("prism-react-renderer/themes/palenight");
const VersionsArchived = require("./versionsArchived.json");
const { themes } = require("prism-react-renderer");
const darkCodeTheme = themes.palenight;
/** @type {import('@docusaurus/types').Config} */
const config = {
@ -28,11 +27,11 @@ const config = {
routeBasePath: "/",
showLastUpdateTime: true,
showLastUpdateAuthor: true,
lastVersion: "2.18",
lastVersion: "2.17",
versions: {
current: {
label: "2.19.0-SNAPSHOT",
path: "2.19.0-SNAPSHOT",
label: "2.18.0-SNAPSHOT",
path: "2.18.0-SNAPSHOT",
},
},
},
@ -235,17 +234,16 @@ const config = {
},
],
createRedirects(existingPath) {
if (existingPath.startsWith("/2.19.0-SNAPSHOT/")) {
if (existingPath.startsWith("/2.18.0-SNAPSHOT/")) {
return [
existingPath.replace("/2.19.0-SNAPSHOT/", "/2.10.0-SNAPSHOT/"),
existingPath.replace("/2.19.0-SNAPSHOT/", "/2.11.0-SNAPSHOT/"),
existingPath.replace("/2.19.0-SNAPSHOT/", "/2.12.0-SNAPSHOT/"),
existingPath.replace("/2.19.0-SNAPSHOT/", "/2.13.0-SNAPSHOT/"),
existingPath.replace("/2.19.0-SNAPSHOT/", "/2.14.0-SNAPSHOT/"),
existingPath.replace("/2.19.0-SNAPSHOT/", "/2.15.0-SNAPSHOT/"),
existingPath.replace("/2.19.0-SNAPSHOT/", "/2.16.0-SNAPSHOT/"),
existingPath.replace("/2.19.0-SNAPSHOT/", "/2.17.0-SNAPSHOT/"),
existingPath.replace("/2.19.0-SNAPSHOT/", "/2.18.0-SNAPSHOT/"),
existingPath.replace("/2.18.0-SNAPSHOT/", "/2.10.0-SNAPSHOT/"),
existingPath.replace("/2.18.0-SNAPSHOT/", "/2.11.0-SNAPSHOT/"),
existingPath.replace("/2.18.0-SNAPSHOT/", "/2.12.0-SNAPSHOT/"),
existingPath.replace("/2.18.0-SNAPSHOT/", "/2.13.0-SNAPSHOT/"),
existingPath.replace("/2.18.0-SNAPSHOT/", "/2.14.0-SNAPSHOT/"),
existingPath.replace("/2.18.0-SNAPSHOT/", "/2.15.0-SNAPSHOT/"),
existingPath.replace("/2.18.0-SNAPSHOT/", "/2.16.0-SNAPSHOT/"),
existingPath.replace("/2.18.0-SNAPSHOT/", "/2.17.0-SNAPSHOT/"),
];
}
return undefined;

@ -9,9 +9,37 @@
"message": "页面已崩溃。",
"description": "The title of the fallback page when the page crashed"
},
"theme.BackToTopButton.buttonAriaLabel": {
"message": "回到顶部",
"description": "The ARIA label for the back to top button"
"theme.NotFound.title": {
"message": "找不到页面",
"description": "The title of the 404 page"
},
"theme.NotFound.p1": {
"message": "我们找不到您要找的页面。",
"description": "The first paragraph of the 404 page"
},
"theme.NotFound.p2": {
"message": "请联系原始链接来源网站的所有者,并告知他们链接已损坏。",
"description": "The 2nd paragraph of the 404 page"
},
"theme.admonition.note": {
"message": "备注",
"description": "The default label used for the Note admonition (:::note)"
},
"theme.admonition.tip": {
"message": "提示",
"description": "The default label used for the Tip admonition (:::tip)"
},
"theme.admonition.danger": {
"message": "危险",
"description": "The default label used for the Danger admonition (:::danger)"
},
"theme.admonition.info": {
"message": "信息",
"description": "The default label used for the Info admonition (:::info)"
},
"theme.admonition.caution": {
"message": "警告",
"description": "The default label used for the Caution admonition (:::caution)"
},
"theme.blog.archive.title": {
"message": "历史博文",
@ -21,6 +49,10 @@
"message": "历史博文",
"description": "The page & hero description of the blog archive page"
},
"theme.BackToTopButton.buttonAriaLabel": {
"message": "回到顶部",
"description": "The ARIA label for the back to top button"
},
"theme.blog.paginator.navAriaLabel": {
"message": "博文列表分页导航",
"description": "The ARIA label for the blog pagination"
@ -45,6 +77,18 @@
"message": "较旧一篇",
"description": "The blog post button label to navigate to the older/next post"
},
"theme.colorToggle.ariaLabel": {
"message": "切换浅色/暗黑模式(当前为{mode}",
"description": "The ARIA label for the navbar color mode toggle"
},
"theme.colorToggle.ariaLabel.mode.dark": {
"message": "暗黑模式",
"description": "The name for the dark color mode"
},
"theme.colorToggle.ariaLabel.mode.light": {
"message": "浅色模式",
"description": "The name for the light color mode"
},
"theme.blog.post.plurals": {
"message": "{count} 篇博文",
"description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
@ -57,26 +101,14 @@
"message": "查看所有标签",
"description": "The label of the link targeting the tag list page"
},
"theme.colorToggle.ariaLabel": {
"message": "切换浅色/暗黑模式(当前为{mode}",
"description": "The ARIA label for the navbar color mode toggle"
},
"theme.colorToggle.ariaLabel.mode.dark": {
"message": "暗黑模式",
"description": "The name for the dark color mode"
},
"theme.colorToggle.ariaLabel.mode.light": {
"message": "浅色模式",
"description": "The name for the light color mode"
"theme.docs.DocCard.categoryDescription": {
"message": "{count} 个项目",
"description": "The default description for a category card in the generated index about how many items this category includes"
},
"theme.docs.breadcrumbs.navAriaLabel": {
"message": "页面路径",
"description": "The ARIA label for the breadcrumbs"
},
"theme.docs.DocCard.categoryDescription.plurals": {
"message": "{count} 个项目",
"description": "The default description for a category card in the generated index about how many items this category includes"
},
"theme.docs.paginator.navAriaLabel": {
"message": "文件选项卡",
"description": "The ARIA label for the docs pagination"
@ -136,10 +168,6 @@
"message": "最后{byUser}{atDate}更新",
"description": "The sentence used to display when a page has been last updated, and by who"
},
"theme.NotFound.title": {
"message": "找不到页面",
"description": "The title of the 404 page"
},
"theme.navbar.mobileVersionsDropdown.label": {
"message": "选择版本",
"description": "The label for the navbar versions dropdown on mobile view"
@ -152,30 +180,6 @@
"message": "关闭",
"description": "The ARIA label for close button of announcement bar"
},
"theme.admonition.caution": {
"message": "警告",
"description": "The default label used for the Caution admonition (:::caution)"
},
"theme.admonition.danger": {
"message": "危险",
"description": "The default label used for the Danger admonition (:::danger)"
},
"theme.admonition.info": {
"message": "信息",
"description": "The default label used for the Info admonition (:::info)"
},
"theme.admonition.note": {
"message": "备注",
"description": "The default label used for the Note admonition (:::note)"
},
"theme.admonition.tip": {
"message": "提示",
"description": "The default label used for the Tip admonition (:::tip)"
},
"theme.admonition.warning": {
"message": "注意",
"description": "The default label used for the Warning admonition (:::warning)"
},
"theme.blog.sidebar.navAriaLabel": {
"message": "最近博文导航",
"description": "The ARIA label for recent posts in the blog sidebar"
@ -196,30 +200,14 @@
"message": "切换自动换行",
"description": "The title attribute for toggle word wrapping button of code block lines"
},
"theme.DocSidebarItem.expandCategoryAriaLabel": {
"message": "展开侧边栏分类 '{label}'",
"description": "The ARIA label to expand the sidebar category"
},
"theme.DocSidebarItem.collapseCategoryAriaLabel": {
"message": "折叠侧边栏分类 '{label}'",
"description": "The ARIA label to collapse the sidebar category"
"theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel": {
"message": "打开/收起侧边栏菜单「{label}」",
"description": "The ARIA label to toggle the collapsible sidebar category"
},
"theme.NavBar.navAriaLabel": {
"message": "主导航",
"description": "The ARIA label for the main navigation"
},
"theme.NotFound.p1": {
"message": "我们找不到您要找的页面。",
"description": "The first paragraph of the 404 page"
},
"theme.NotFound.p2": {
"message": "请联系原始链接来源网站的所有者,并告知他们链接已损坏。",
"description": "The 2nd paragraph of the 404 page"
},
"theme.navbar.mobileLanguageDropdown.label": {
"message": "选择语言",
"description": "The label for the mobile language switcher dropdown"
},
"theme.TOCCollapsible.toggleButtonLabel": {
"message": "本页总览",
"description": "The label used by the button on the collapsible TOC component"
@ -228,6 +216,10 @@
"message": "阅读需 {readingTime} 分钟",
"description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)"
},
"theme.navbar.mobileLanguageDropdown.label": {
"message": "选择语言",
"description": "The label for the mobile language switcher dropdown"
},
"theme.blog.post.readMore": {
"message": "阅读更多",
"description": "The label used in blog post item excerpts to link to full blog posts"
@ -260,10 +252,6 @@
"message": "← 回到主菜单",
"description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)"
},
"theme.docs.sidebar.toggleSidebarButtonAriaLabel": {
"message": "切换导航栏",
"description": "The ARIA label for hamburger menu button of mobile navigation"
},
"theme.docs.sidebar.expandButtonTitle": {
"message": "展开侧边栏",
"description": "The ARIA label and title attribute for expand button of doc sidebar"
@ -272,6 +260,10 @@
"message": "展开侧边栏",
"description": "The ARIA label and title attribute for expand button of doc sidebar"
},
"theme.docs.sidebar.toggleSidebarButtonAriaLabel": {
"message": "切换导航栏",
"description": "The ARIA label for hamburger menu button of mobile navigation"
},
"theme.ErrorPageContent.tryAgain": {
"message": "重试",
"description": "The label of the button to try again rendering when the React error boundary captures an error"
@ -283,13 +275,5 @@
"theme.tags.tagsPageTitle": {
"message": "标签",
"description": "The title of the tag list page"
},
"theme.unlistedContent.title": {
"message": "未列出页",
"description": "The unlisted content banner title"
},
"theme.unlistedContent.message": {
"message": "此页面未列出。搜索引擎不会对其索引,只有拥有直接链接的用户才能访问。",
"description": "The unlisted content banner message"
}
}

@ -1,6 +1,6 @@
{
"version.label": {
"message": "2.19.0-SNAPSHOT",
"message": "2.18.0-SNAPSHOT",
"description": "The label for version current"
},
"sidebar.tutorial.category.入门": {

@ -1,78 +0,0 @@
{
"version.label": {
"message": "2.18",
"description": "The label for version 2.18"
},
"sidebar.tutorial.category.入门": {
"message": "入门",
"description": "The label for category 入门 in sidebar tutorial"
},
"sidebar.tutorial.category.安装指南": {
"message": "安装指南",
"description": "The label for category 安装指南 in sidebar tutorial"
},
"sidebar.tutorial.category.云平台": {
"message": "云平台",
"description": "The label for category 云平台 in sidebar tutorial"
},
"sidebar.tutorial.category.其他指南": {
"message": "其他指南",
"description": "The label for category 其他指南 in sidebar tutorial"
},
"sidebar.tutorial.category.用户指南": {
"message": "用户指南",
"description": "The label for category 用户指南 in sidebar tutorial"
},
"sidebar.tutorial.category.参与贡献": {
"message": "参与贡献",
"description": "The label for category 参与贡献 in sidebar tutorial"
},
"sidebar.developer.category.系统开发": {
"message": "系统开发",
"description": "The label for category 系统开发 in sidebar developer"
},
"sidebar.developer.category.插件开发": {
"message": "插件开发",
"description": "The label for category 插件开发 in sidebar developer"
},
"sidebar.developer.category.基础": {
"message": "基础",
"description": "The label for category 基础 in sidebar developer"
},
"sidebar.developer.category.服务端": {
"message": "服务端",
"description": "The label for category 服务端 in sidebar developer"
},
"sidebar.developer.category.UI": {
"message": "UI",
"description": "The label for category UI in sidebar developer"
},
"sidebar.developer.category.API 参考": {
"message": "API 参考",
"description": "The label for category API 参考 in sidebar developer"
},
"sidebar.developer.category.扩展点": {
"message": "扩展点",
"description": "The label for category 扩展点 in sidebar developer"
},
"sidebar.developer.category.组件": {
"message": "组件",
"description": "The label for category 组件 in sidebar developer"
},
"sidebar.developer.category.案例和最佳实践": {
"message": "案例和最佳实践",
"description": "The label for category 案例和最佳实践 in sidebar developer"
},
"sidebar.developer.category.主题开发": {
"message": "主题开发",
"description": "The label for category 主题开发 in sidebar developer"
},
"sidebar.developer.category.模板变量": {
"message": "模板变量",
"description": "The label for category 模板变量 in sidebar developer"
},
"sidebar.developer.category.Finder API": {
"message": "Finder API",
"description": "The label for category Finder API in sidebar developer"
}
}

@ -1,57 +0,0 @@
const fs = require('fs');
const path = require('path');
// 指定要扫描的目录
const directoryPath = './docs';
// 递归读取目录中的所有 Markdown 文件
function readDirectory(directory) {
fs.readdir(directory, (err, files) => {
if (err) {
return console.log('无法扫描目录: ' + err);
}
files.forEach(file => {
const filePath = path.join(directory, file);
fs.stat(filePath, (err, stats) => {
if (err) {
return console.log('无法获取文件信息: ' + err);
}
if (stats.isDirectory()) {
// 如果是目录,递归读取
readDirectory(filePath);
} else if (path.extname(file) === '.md') {
// 如果是 Markdown 文件,处理文件内容
processMarkdownFile(filePath);
}
});
});
});
}
// 处理 Markdown 文件内容
function processMarkdownFile(filePath) {
fs.readFile(filePath, 'utf8', (err, data) => {
if (err) {
return console.log('无法读取文件: ' + err);
}
// 使用正则表达式匹配 <https://ryanc.cc> 形式的链接
const updatedData = data.replace(/<https:\/\/[^\s]+>/g, match => {
const url = match.slice(1, -1); // 去掉尖括号
return `[${url}](${url})`;
});
// 将更新后的内容写回文件
fs.writeFile(filePath, updatedData, 'utf8', err => {
if (err) {
return console.log('无法写入文件: ' + err);
}
console.log(`已处理文件: ${filePath}`);
});
});
}
// 开始扫描目录
readDirectory(directoryPath);

@ -3,17 +3,35 @@
"version": "0.0.0",
"private": true,
"scripts": {
"build": "docusaurus build",
"clear": "docusaurus clear",
"deploy": "docusaurus deploy",
"docusaurus": "docusaurus",
"lint": "markdownlint-cli2 \"./docs/**/*.md\" \"./versioned_docs/**/*.md\"",
"prepare": "husky install",
"serve": "docusaurus serve",
"docusaurus": "docusaurus",
"start": "docusaurus start",
"build": "docusaurus build",
"swizzle": "docusaurus swizzle",
"deploy": "docusaurus deploy",
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"write-translations": "docusaurus write-translations"
"lint": "markdownlint-cli2 \"./docs/**/*.md\" \"./versioned_docs/**/*.md\""
},
"dependencies": {
"@docusaurus/core": "2.4.1",
"@docusaurus/plugin-client-redirects": "^2.4.1",
"@docusaurus/preset-classic": "2.4.1",
"@docusaurus/theme-classic": "2.4.1",
"@docusaurus/theme-common": "2.4.1",
"@mdx-js/react": "^1.6.22",
"@svgr/webpack": "^5.5.0",
"clsx": "^1.2.1",
"docusaurus-plugin-image-zoom": "^1.0.1",
"file-loader": "^6.2.0",
"hast-util-is-element": "1.1.0",
"meilisearch-docsearch": "^0.6.0",
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"url-loader": "^4.1.1"
},
"browserslist": {
"production": [
@ -27,33 +45,12 @@
"last 1 safari version"
]
},
"dependencies": {
"@docusaurus/core": "3.4.0",
"@docusaurus/plugin-client-redirects": "^3.4.0",
"@docusaurus/preset-classic": "3.4.0",
"@docusaurus/theme-classic": "3.4.0",
"@docusaurus/theme-common": "3.4.0",
"@mdx-js/react": "^3.0.0",
"@svgr/webpack": "^5.5.0",
"clsx": "^1.2.1",
"docusaurus-plugin-image-zoom": "^1.0.1",
"file-loader": "^6.2.0",
"hast-util-is-element": "1.1.0",
"meilisearch-docsearch": "^0.6.0",
"prism-react-renderer": "^2.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"url-loader": "^4.1.1"
},
"devDependencies": {
"@docusaurus/module-type-aliases": "^3.4.0",
"@docusaurus/module-type-aliases": "^2.4.1",
"@swc/core": "^1.5.7",
"husky": "^7.0.4",
"markdownlint": "^0.25.1",
"markdownlint-cli2": "^0.4.0",
"swc-loader": "^0.2.6"
},
"engines": {
"node": ">=18.0"
}
}

File diff suppressed because it is too large Load Diff

@ -185,7 +185,6 @@ module.exports = {
"developer-guide/plugin/api-reference/server/template-for-theme",
"developer-guide/plugin/api-reference/server/websocket",
"developer-guide/plugin/api-reference/server/login-handler-enhancer",
"developer-guide/plugin/api-reference/server/extension-getter",
{
type: "category",
label: "扩展点",
@ -235,8 +234,6 @@ module.exports = {
"developer-guide/plugin/api-reference/ui/extension-points/plugin-installation-tabs-create",
"developer-guide/plugin/api-reference/ui/extension-points/theme-list-tabs-create",
"developer-guide/plugin/api-reference/ui/extension-points/post-list-item-operation-create",
"developer-guide/plugin/api-reference/ui/extension-points/comment-list-item-operation-create",
"developer-guide/plugin/api-reference/ui/extension-points/reply-list-item-operation-create",
"developer-guide/plugin/api-reference/ui/extension-points/plugin-list-item-operation-create",
"developer-guide/plugin/api-reference/ui/extension-points/backup-list-item-operation-create",
"developer-guide/plugin/api-reference/ui/extension-points/attachment-list-item-operation-create",

@ -9,7 +9,7 @@ description: 问题反馈渠道及指南
## GitHub Issues
链接:[https://github.com/halo-dev/halo/issues](https://github.com/halo-dev/halo/issues)
链接:<https://github.com/halo-dev/halo/issues>
如果你在使用过程中,遇到了一些 bug 或者需要添加某些新特性,请尽量在 GitHub Issues 进行反馈,这非常有助于我们跟踪解决此问题,您也可以很方便的接收到处理状态。
@ -23,6 +23,6 @@ description: 问题反馈渠道及指南
## Halo 官方社区
链接:[https://bbs.halo.run](https://bbs.halo.run)
链接:<https://bbs.halo.run>
此平台主要目的用于与其他 Halo 用户进行交流。但如果您对 GitHub 不是很熟悉或者没有账号,您也可以在此平台进行反馈。

@ -15,12 +15,12 @@ description: 如果 Halo 对你有帮助,不妨赞助我们
### 资金赞助
- 爱发电:[https://afdian.com/a/halo-dev](https://afdian.com/a/halo-dev)
- 爱发电:<https://afdian.net/a/halo-dev>
### 通过我们的推广链接购买服务器
如果你当前还没有购买服务器,可以考虑通过以下链接购买,这会为我们带来一部分收益。
- 阿里云:[https://www.aliyun.com/daily-act/ecs/activity_selection?userCode=j57gyupo](https://www.aliyun.com/daily-act/ecs/activity_selection?userCode=j57gyupo)
- 阿里云新人专享:[https://www.aliyun.com/minisite/goods?userCode=j57gyupo](https://www.aliyun.com/minisite/goods?userCode=j57gyupo)
- 腾讯云:[https://curl.qcloud.com/9Ogon25Y](https://curl.qcloud.com/9Ogon25Y)
- 阿里云:<https://www.aliyun.com/daily-act/ecs/activity_selection?userCode=j57gyupo>
- 阿里云新人专享:<https://www.aliyun.com/minisite/goods?userCode=j57gyupo>
- 腾讯云:<https://curl.qcloud.com/9Ogon25Y>

@ -34,7 +34,7 @@ git checkout v2.4.0
:::warning
从 2.4.0 开始Console 项目已经合并到 Halo 主项目,所以不再需要单独克隆 Console 的项目仓库。
详情可查阅:[https://github.com/halo-dev/halo/issues/3393](https://github.com/halo-dev/halo/issues/3393)
详情可查阅:<https://github.com/halo-dev/halo/issues/3393>
:::
## 构建 Console

@ -34,7 +34,7 @@ git clone git@github.com:halo-dev/halo.git
:::warning
从 2.4.0 开始Console 项目已经合并到 Halo 主项目,所以不再需要单独克隆 Console 的项目仓库。
详情可查阅:[https://github.com/halo-dev/halo/issues/3393](https://github.com/halo-dev/halo/issues/3393)
详情可查阅:<https://github.com/halo-dev/halo/issues/3393>
:::
## 运行 Console

@ -8,8 +8,8 @@ title: 表单定义
FormKit 相关文档:
- Form Schema: [https://formkit.com/essentials/schema](https://formkit.com/essentials/schema)
- FormKit Inputs: [https://formkit.com/inputs](https://formkit.com/inputs)
- Form Schema: <https://formkit.com/essentials/schema>
- FormKit Inputs: <https://formkit.com/inputs>
:::tip
目前不支持 FormKit Pro 中的输入组件,但 Halo 额外提供了部分输入组件,将在下面文档列出。

@ -42,4 +42,4 @@ spec:
- `spec.homepage`:通常为插件的 GitHub 仓库链接,或可联系到插件作者或插件官网或帮助中心链接等。
- `spec.displayName`:插件的显示名称,它通常是以少数几个字来概括插件的用途。
- `spec.description`:插件描述,用一段话来介绍插件的用途。
- `spec.license`:插件使用的软件协议,参考:[https://en.wikipedia.org/wiki/Software_license](https://en.wikipedia.org/wiki/Software_license)
- `spec.license`:插件使用的软件协议,参考:<https://en.wikipedia.org/wiki/Software_license>

@ -73,7 +73,7 @@ spec:
为了方便主题开发者从 1.x 迁移,我们提供了工具用于迁移配置文件。
工具仓库地址:[https://github.com/halo-sigs/convert-theme-config-to-next](https://github.com/halo-sigs/convert-theme-config-to-next)
工具仓库地址:<https://github.com/halo-sigs/convert-theme-config-to-next>
```bash
# 1.x 版本主题

@ -48,7 +48,7 @@ categoryFinder.getByNames(names)
### 返回值
List\<[#CategoryVo](#categoryvo)\>
List<[#CategoryVo](#categoryvo)>
### 示例
@ -75,7 +75,7 @@ categoryFinder.list(page,size)
### 返回值
[#ListResult\<CategoryVo\>](#listresultcategoryvo)
[#ListResult<CategoryVo\>](#listresultcategoryvo)
### 示例
@ -103,7 +103,7 @@ categoryFinder.listAll()
### 返回值
List\<[#CategoryVo](#categoryvo)\>
List<[#CategoryVo](#categoryvo)>
### 示例
@ -131,7 +131,7 @@ categoryFinder.listAsTree()
### 返回值
List\<[#CategoryTreeVo](#categorytreevo)\>
List<[#CategoryTreeVo](#categorytreevo)>
### 示例
@ -162,7 +162,7 @@ List\<[#CategoryTreeVo](#categorytreevo)\>
<CategoryVo />
### ListResult\<CategoryVo\>
### ListResult<CategoryVo\>
```json title="ListResult<CategoryVo>"
{

@ -53,7 +53,7 @@ commentFinder.list(ref,page,size)
### 返回值
[#ListResult\<CommentVo\>](#listresultcommentvo)
[#ListResult<CommentVo\>](#listresultcommentvo)
### 示例
@ -84,7 +84,7 @@ commentFinder.listReply(commentName,page,size)
### 返回值
[#ListResult\<ReplyVo\>](#listresultreplyvo)
[#ListResult<ReplyVo\>](#listresultreplyvo)
### 示例
@ -103,7 +103,7 @@ commentFinder.listReply(commentName,page,size)
<CommentVo />
### ListResult\<CommentVo\>
### ListResult<CommentVo\>
```json title="ListResult<CommentVo>"
{
@ -125,7 +125,7 @@ commentFinder.listReply(commentName,page,size)
<ReplyVo />
### ListResult\<ReplyVo\>
### ListResult<ReplyVo\>
```json title="ListResult<ReplyVo>"
{

@ -47,7 +47,7 @@ contributorFinder.getContributors(names)
### 返回值
List\<[#ContributorVo](#contributorvo)\>
List<[#ContributorVo](#contributorvo)>
### 示例

@ -115,7 +115,7 @@ postFinder.listAll();
### 返回值
List\<[#ListedPostVo](#listedpostvo)\>
List<[#ListedPostVo](#listedpostvo)>
### 示例
@ -144,7 +144,7 @@ postFinder.list(page, size);
### 返回值
[#ListResult\<ListedPostVo\>](#listresultlistedpostvo)
[#ListResult<ListedPostVo\>](#listresultlistedpostvo)
### 示例
@ -174,7 +174,7 @@ postFinder.listByCategory(page, size, categoryName);
### 返回值
[#ListResult\<ListedPostVo\>](#listresultlistedpostvo)
[#ListResult<ListedPostVo\>](#listresultlistedpostvo)
### 示例
@ -204,7 +204,7 @@ postFinder.listByTag(page, size, tag);
### 返回值
[#ListResult\<ListedPostVo\>](#listresultlistedpostvo)
[#ListResult<ListedPostVo\>](#listresultlistedpostvo)
### 示例
@ -233,7 +233,7 @@ postFinder.archives(page, size);
### 返回值
[#ListResult\<PostArchiveVo\>](#listresultpostarchivevo)
[#ListResult<PostArchiveVo\>](#listresultpostarchivevo)
### 示例
@ -271,7 +271,7 @@ postFinder.archives(page, size, year);
### 返回值
[#ListResult\<PostArchiveVo\>](#listresultpostarchivevo)
[#ListResult<PostArchiveVo\>](#listresultpostarchivevo)
### 示例
@ -310,7 +310,7 @@ postFinder.archives(page, size, year, month);
### 返回值
[#ListResult\<PostArchiveVo\>](#listresultpostarchivevo)
[#ListResult<PostArchiveVo\>](#listresultpostarchivevo)
### 示例
@ -371,13 +371,13 @@ postFinder.archives(page, size, year, month);
### ListedPostVo
\<ListedPostVo \/\>
<ListedPostVo />
- [#CategoryVo](#categoryvo)
- [#TagVo](#tagvo)
- [#ContributorVo](#contributorvo)
### ListResult\<ListedPostVo\>
### ListResult<ListedPostVo\>
```json title="ListResult<ListedPostVo>"
{
@ -411,7 +411,7 @@ postFinder.archives(page, size, year, month);
- [#ListedPostVo](#listedpostvo)
### ListResult\<PostArchiveVo\>
### ListResult<PostArchiveVo\>
```json title="ListResult<PostArchiveVo>"
{

@ -77,7 +77,7 @@ singlePageFinder.list(page,size)
### 返回值
[#ListResult\<ListedSinglePageVo\>](#listresultlistedsinglepagevo)
[#ListResult<ListedSinglePageVo\>](#listresultlistedsinglepagevo)
### 示例
@ -104,7 +104,7 @@ singlePageFinder.list(page,size)
<ListedSinglePageVo />
### ListResult\<ListedSinglePageVo\>
### ListResult<ListedSinglePageVo\>
```json title="ListResult<ListedSinglePageVo>"
{

@ -47,7 +47,7 @@ tagFinder.getByNames(names)
### 返回值
List\<[#TagVo](#tagvo)\>
List<[#TagVo](#tagvo)>
### 示例
@ -74,7 +74,7 @@ tagFinder.list(page,size)
### 返回值
[#ListResult\<TagVo\>](#listresulttagvo)
[#ListResult<TagVo\>](#listresulttagvo)
### 示例
@ -102,7 +102,7 @@ tagFinder.listAll()
### 返回值
List\<[#TagVo](#tagvo)\>
List<[#TagVo](#tagvo)>
### 示例
@ -120,7 +120,7 @@ List\<[#TagVo](#tagvo)\>
<TagVo />
### ListResult\<TagVo\>
### ListResult<TagVo\>
```json title="ListResult<TagVo>"
{

@ -119,7 +119,7 @@ Setting 资源的 `metadata.name` 必须和 `theme.yaml` 中的 `spec.settingNam
为了方便主题开发者从 1.x 迁移,我们提供了工具用于迁移设置表单配置文件。
工具仓库地址:[https://github.com/halo-sigs/convert-theme-config-to-next](https://github.com/halo-sigs/convert-theme-config-to-next)
工具仓库地址:<https://github.com/halo-sigs/convert-theme-config-to-next>
```bash
# 1.x 版本主题

@ -22,7 +22,7 @@ import ListedPostVo from "../vo/_ListedPostVo.md";
#### 变量类型
[#UrlContextListResult\<PostArchiveVo\>](#urlcontextlistresultpostarchivevo)
[#UrlContextListResult<PostArchiveVo\>](#urlcontextlistresultpostarchivevo)
#### 示例
@ -65,7 +65,7 @@ import ListedPostVo from "../vo/_ListedPostVo.md";
### ListedPostVo
\<ListedPostVo \/\>
<ListedPostVo />
- [#CategoryVo](#categoryvo)
- [#TagVo](#tagvo)
@ -87,7 +87,7 @@ import ListedPostVo from "../vo/_ListedPostVo.md";
- [#ListedPostVo](#listedpostvo)
### UrlContextListResult\<PostArchiveVo\>
### UrlContextListResult<PostArchiveVo\>
```json title="UrlContextListResult<PostArchiveVo>"
{

@ -26,7 +26,7 @@ import ListedPostVo from "../vo/_ListedPostVo.md"
#### 变量类型
[#UrlContextListResult\<ListedPostVo\>](#urlcontextlistresultlistedpostvo)
[#UrlContextListResult<ListedPostVo\>](#urlcontextlistresultlistedpostvo)
#### 示例
@ -77,13 +77,13 @@ import ListedPostVo from "../vo/_ListedPostVo.md"
### ListedPostVo
\<ListedPostVo \/\>
<ListedPostVo />
- [#CategoryVo](#categoryvo)
- [#TagVo](#tagvo)
- [#ContributorVo](#contributorvo)
### UrlContextListResult\<ListedPostVo\>
### UrlContextListResult<ListedPostVo\>
```json title="UrlContextListResult<ListedPostVo>"
{

@ -16,7 +16,7 @@ import CategoryTreeVo from "../vo/_CategoryTreeVo.md"
#### 变量类型
List\<[#CategoryTreeVo](#categorytreevo)\>
List<[#CategoryTreeVo](#categorytreevo)>
#### 示例

@ -25,7 +25,7 @@ import ListedPostVo from "../vo/_ListedPostVo.md"
#### 变量类型
[#UrlContextListResult\<ListedPostVo\>](#urlcontextlistresultlistedpostvo)
[#UrlContextListResult<ListedPostVo\>](#urlcontextlistresultlistedpostvo)
#### 示例
@ -78,13 +78,13 @@ import ListedPostVo from "../vo/_ListedPostVo.md"
### ListedPostVo
\<ListedPostVo \/\>
<ListedPostVo />
- [#CategoryVo](#categoryvo)
- [#TagVo](#tagvo)
- [#ContributorVo](#contributorvo)
### UrlContextListResult\<ListedPostVo\>
### UrlContextListResult<ListedPostVo\>
```json title="UrlContextListResult<ListedPostVo>"
{

@ -19,7 +19,7 @@ import ListedPostVo from "../vo/_ListedPostVo.md"
#### 变量类型
[#UrlContextListResult\<ListedPostVo\>](#urlcontextlistresultlistedpostvo)
[#UrlContextListResult<ListedPostVo\>](#urlcontextlistresultlistedpostvo)
#### 示例
@ -71,13 +71,13 @@ import ListedPostVo from "../vo/_ListedPostVo.md"
### ListedPostVo
\<ListedPostVo \/\>
<ListedPostVo />
- [#CategoryVo](#categoryvo)
- [#TagVo](#tagvo)
- [#ContributorVo](#contributorvo)
### UrlContextListResult\<ListedPostVo\>
### UrlContextListResult<ListedPostVo\>
```json title="UrlContextListResult<ListedPostVo>"
{

@ -25,7 +25,7 @@ import ListedPostVo from "../vo/_ListedPostVo.md"
#### 变量类型
[#UrlContextListResult\<ListedPostVo\>](#urlcontextlistresultlistedpostvo)
[#UrlContextListResult<ListedPostVo\>](#urlcontextlistresultlistedpostvo)
#### 示例
@ -78,13 +78,13 @@ import ListedPostVo from "../vo/_ListedPostVo.md"
### ListedPostVo
\<ListedPostVo \/\>
<ListedPostVo />
- [#CategoryVo](#categoryvo)
- [#TagVo](#tagvo)
- [#ContributorVo](#contributorvo)
### UrlContextListResult\<ListedPostVo\>
### UrlContextListResult<ListedPostVo\>
```json title="UrlContextListResult<ListedPostVo>"
{

@ -16,7 +16,7 @@ import TagVo from '../vo/_TagVo.md'
#### 变量类型
List\<[#TagVo](#tagvo)\>
List<[#TagVo](#tagvo)>
#### 示例

@ -11,8 +11,8 @@ import DockerArgs from "./slots/_docker-args.md"
## 环境搭建
- Docker 安装文档:[https://docs.docker.com/engine/install/](https://docs.docker.com/engine/install/)
- Docker Compose 安装文档:[https://docs.docker.com/compose/install/](https://docs.docker.com/compose/install/)
- Docker 安装文档:<https://docs.docker.com/engine/install/>
- Docker Compose 安装文档:<https://docs.docker.com/compose/install/>
:::tip
我们推荐按照 Docker 官方文档安装 Docker 和 Docker Compose因为部分 Linux 发行版软件仓库中的 Docker 版本可能过旧。
@ -176,7 +176,7 @@ import DockerArgs from "./slots/_docker-args.md"
3. 仅创建 Halo 实例(使用默认的 H2 数据库):
:::warning
:::caution
不推荐在生产环境使用默认的 H2 数据库,这可能因为操作不当导致数据文件损坏。如果因为某些原因(如内存不足以运行独立数据库)必须要使用,建议按时[备份数据](../../user-guide/backup.md)。
:::
@ -202,7 +202,6 @@ import DockerArgs from "./slots/_docker-args.md"
# 外部访问地址,请根据实际需要修改
- --halo.external-url=http://localhost:8090/
```
4. 仅创建 Halo 实例使用已有外部数据库MySQL 为例):
```yaml {8,12-20} title="~/halo/docker-compose.yaml"

@ -9,7 +9,7 @@ import DockerArgs from "./slots/_docker-args.md"
在继续操作之前,我们推荐您先阅读[《写在前面》](../prepare),这可以快速帮助你了解 Halo。
:::
:::warning
:::caution
此文档仅提供使用默认 H2 数据库的 Docker 运行方式,主要用于体验和测试,在生产环境我们不推荐使用 H2 数据库,这可能因为操作不当导致数据文件损坏。如果因为某些原因(如内存不足以运行独立数据库)必须要使用,建议按时[备份数据](../../user-guide/backup.md)。
如果需要使用其他数据库部署,我们推荐使用 Docker Compose 部署:[使用 Docker Compose 部署](./docker-compose)
@ -17,7 +17,7 @@ import DockerArgs from "./slots/_docker-args.md"
## 环境搭建
- Docker 安装文档:[https://docs.docker.com/engine/install/](https://docs.docker.com/engine/install/)
- Docker 安装文档:<https://docs.docker.com/engine/install/>
:::tip
我们推荐按照 Docker 官方文档安装 Docker因为部分 Linux 发行版软件仓库中的 Docker 版本可能过旧。
@ -59,7 +59,7 @@ import DockerArgs from "./slots/_docker-args.md"
<DockerArgs />
2. 用浏览器访问 `/console` 即可进入 Halo 管理页面,首次启动会进入初始化页面。
1. 用浏览器访问 `/console` 即可进入 Halo 管理页面,首次启动会进入初始化页面。
:::tip
如果需要配置域名访问,建议先配置好反向代理以及域名解析再进行初始化。如果通过 `http://ip:端口号` 的形式无法访问,请到服务器厂商后台将运行的端口号添加到安全组,如果服务器使用了 Linux 面板,请检查此 Linux 面板是否有还有安全组配置,需要同样将端口号添加到安全组。

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save