Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update documentation for Halo 2.13 #321

Merged
merged 4 commits into from Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/developer-guide/core/build.md
Expand Up @@ -33,7 +33,7 @@ git checkout ${branch_name}

## 构建 Fat Jar

构建之前需要修改 `gradle.properties` 中的 `version` 属性(推荐遵循 [SemVer 规范](https://semver.org/)),例如:`version=2.12.0`
构建之前需要修改 `gradle.properties` 中的 `version` 属性(推荐遵循 [SemVer 规范](https://semver.org/)),例如:`version=2.13.0`

```bash
cd path/to/halo
Expand Down
22 changes: 11 additions & 11 deletions docs/getting-started/install/docker-compose.md
Expand Up @@ -20,18 +20,18 @@ import DockerArgs from "./slots/docker-args.md"

## 创建容器组

可用的 Halo 2.12 的 Docker 镜像:
可用的 Halo 2.13 的 Docker 镜像:

- [halohub/halo](https://hub.docker.com/r/halohub/halo)
- [ghcr.io/halo-dev/halo](https://github.com/halo-dev/halo/pkgs/container/halo)

:::info 注意
目前 Halo 2 并未更新 Docker 的 latest 标签镜像,主要因为 Halo 2 不兼容 1.x 版本,防止使用者误操作。我们推荐使用固定版本的标签,比如 `halohub/halo:2.12` 或者 `halohub/halo:2.12.0`。
目前 Halo 2 并未更新 Docker 的 latest 标签镜像,主要因为 Halo 2 不兼容 1.x 版本,防止使用者误操作。我们推荐使用固定版本的标签,比如 `halohub/halo:2.13` 或者 `halohub/halo:2.13.0`。

- `halohub/halo:2.12`:表示最新的 2.12.x 版本,即每次发布 patch 版本都会同时更新 `halohub/halo:2.12` 镜像。
- `halohub/halo:2.12.0`:表示一个具体的版本。
- `halohub/halo:2.13`:表示最新的 2.13.x 版本,即每次发布 patch 版本都会同时更新 `halohub/halo:2.13` 镜像。
- `halohub/halo:2.13.0`:表示一个具体的版本。

后续文档以 `halohub/halo:2.12` 为例。
后续文档以 `halohub/halo:2.13` 为例。
:::

1. 在系统任意位置创建一个文件夹,此文档以 `~/halo` 为例。
Expand Down Expand Up @@ -59,7 +59,7 @@ import DockerArgs from "./slots/docker-args.md"

services:
halo:
image: halohub/halo:2.12
image: halohub/halo:2.13
container_name: halo
restart: on-failure:3
depends_on:
Expand Down Expand Up @@ -117,7 +117,7 @@ import DockerArgs from "./slots/docker-args.md"

services:
halo:
image: halohub/halo:2.12
image: halohub/halo:2.13
container_name: halo
restart: on-failure:3
depends_on:
Expand Down Expand Up @@ -185,7 +185,7 @@ import DockerArgs from "./slots/docker-args.md"

services:
halo:
image: halohub/halo:2.12
image: halohub/halo:2.13
container_name: halo
restart: on-failure:3
volumes:
Expand All @@ -210,7 +210,7 @@ import DockerArgs from "./slots/docker-args.md"

services:
halo:
image: halohub/halo:2.12
image: halohub/halo:2.13
container_name: halo
restart: on-failure:3
network_mode: "host"
Expand Down Expand Up @@ -260,7 +260,7 @@ import DockerArgs from "./slots/docker-args.md"
```yaml {3}
services:
halo:
image: halohub/halo:2.12
image: halohub/halo:2.13
container_name: halo
```

Expand Down Expand Up @@ -325,7 +325,7 @@ networks:

services:
halo:
image: halohub/halo:2.12
image: halohub/halo:2.13
container_name: halo
restart: on-failure:3
volumes:
Expand Down
16 changes: 8 additions & 8 deletions docs/getting-started/install/docker.md
Expand Up @@ -25,24 +25,24 @@ import DockerArgs from "./slots/docker-args.md"

## 使用 Docker 镜像

可用的 Halo 2.12 的 Docker 镜像:
可用的 Halo 2.13 的 Docker 镜像:

- [halohub/halo](https://hub.docker.com/r/halohub/halo)
- [ghcr.io/halo-dev/halo](https://github.com/halo-dev/halo/pkgs/container/halo)

:::info 注意
目前 Halo 2 并未更新 Docker 的 latest 标签镜像,主要因为 Halo 2 不兼容 1.x 版本,防止使用者误操作。我们推荐使用固定版本的标签,比如 `halohub/halo:2.12` 或者 `halohub/halo:2.12.0`。
目前 Halo 2 并未更新 Docker 的 latest 标签镜像,主要因为 Halo 2 不兼容 1.x 版本,防止使用者误操作。我们推荐使用固定版本的标签,比如 `halohub/halo:2.13` 或者 `halohub/halo:2.13.0`。

- `halohub/halo:2.12`:表示最新的 2.12.x 版本,即每次发布 patch 版本都会同时更新 `halohub/halo:2.12` 镜像。
- `halohub/halo:2.12.0`:表示一个具体的版本。
- `halohub/halo:2.13`:表示最新的 2.13.x 版本,即每次发布 patch 版本都会同时更新 `halohub/halo:2.13` 镜像。
- `halohub/halo:2.13.0`:表示一个具体的版本。

后续文档以 `halohub/halo:2.12` 为例。
后续文档以 `halohub/halo:2.13` 为例。
:::

1. 创建容器

```bash
docker run -it -d --name halo -p 8090:8090 -v ~/.halo2:/root/.halo2 halohub/halo:2.12
docker run -it -d --name halo -p 8090:8090 -v ~/.halo2:/root/.halo2 halohub/halo:2.13
```

:::info
Expand Down Expand Up @@ -71,7 +71,7 @@ import DockerArgs from "./slots/docker-args.md"
2. 拉取新版本镜像

```bash
docker pull halohub/halo:2.12
docker pull halohub/halo:2.13
```

3. 停止运行中的容器
Expand All @@ -86,5 +86,5 @@ import DockerArgs from "./slots/docker-args.md"
修改版本号后,按照最初安装的方式,重新创建容器即可。

```bash
docker run -it -d --name halo -p 8090:8090 -v ~/.halo2:/root/.halo2 halohub/halo:2.12
docker run -it -d --name halo -p 8090:8090 -v ~/.halo2:/root/.halo2 halohub/halo:2.13
```
6 changes: 3 additions & 3 deletions docs/getting-started/install/jar-file.md
Expand Up @@ -53,7 +53,7 @@ title: 使用 JAR 文件部署
3. 下载运行包

```bash
wget https://dl.halo.run/release/halo-2.12.2.jar -O halo.jar
wget https://dl.halo.run/release/halo-2.13.0.jar -O halo.jar
```

:::info
Expand Down Expand Up @@ -244,7 +244,7 @@ journalctl -n 20 -u halo
3. 下载新版本的 Halo 运行包,覆盖原有的运行包

```bash
wget https://dl.halo.run/release/halo-2.12.2.jar -O /home/halo/app/halo.jar
wget https://dl.halo.run/release/halo-2.13.0.jar -O /home/halo/app/halo.jar
```

4. 启动 Halo 服务
Expand Down Expand Up @@ -310,7 +310,7 @@ networks:

services:
halo:
image: halohub/halo:2.12
image: halohub/halo:2.13
container_name: halo
restart: on-failure:3
volumes:
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/install/other/traefik.md
Expand Up @@ -96,7 +96,7 @@ networks:

services:
halo:
image: halohub/halo:2.12
image: halohub/halo:2.13
container_name: halo
restart: on-failure:3
volumes:
Expand Down
22 changes: 11 additions & 11 deletions docs/getting-started/install/podman.md
Expand Up @@ -50,25 +50,25 @@ Podman 采用无守护进程的包容性架构,因此可以更安全、更简
通过[前言](#前言)我们已经了解了 Podman ,其中提到 ***Podman 与 Docker 高度兼容*** ,正是因为 Podman 完全是为了替代 Docker 而诞生,所以原本的 Docker 生态中的镜像我们可以无需更改直接使用。
:::

可用的 Halo 2.12 的 Docker 镜像:
可用的 Halo 2.13 的 Docker 镜像:

- [halohub/halo](https://hub.docker.com/r/halohub/halo)
- [ghcr.io/halo-dev/halo](https://github.com/halo-dev/halo/pkgs/container/halo)

:::info 注意
目前 Halo 2 并未更新 Docker 的 latest 标签镜像,主要因为 Halo 2 不兼容 1.x 版本,防止使用者误操作。我们推荐使用固定版本的标签,比如 `halohub/halo:2.12` 或者 `halohub/halo:2.12.0`。
目前 Halo 2 并未更新 Docker 的 latest 标签镜像,主要因为 Halo 2 不兼容 1.x 版本,防止使用者误操作。我们推荐使用固定版本的标签,比如 `halohub/halo:2.13` 或者 `halohub/halo:2.13.0`。

- `halohub/halo:2.12`:表示最新的 2.12.x 版本,即每次发布 patch 版本都会同时更新 `halohub/halo:2.12` 镜像。
- `halohub/halo:2.12.0`:表示一个具体的版本。
- `halohub/halo:2.13`:表示最新的 2.13.x 版本,即每次发布 patch 版本都会同时更新 `halohub/halo:2.13` 镜像。
- `halohub/halo:2.13.0`:表示一个具体的版本。

后续文档以 `halohub/halo:2.12` 为例。
后续文档以 `halohub/halo:2.13` 为例。
:::

1. 创建容器

```bash
mkdir -p ~/.halo2
podman run -it -d --name halo -p 8090:8090 -v ~/.halo2:/root/.halo2 halohub/halo:2.12
podman run -it -d --name halo -p 8090:8090 -v ~/.halo2:/root/.halo2 halohub/halo:2.13
```

:::info
Expand Down Expand Up @@ -97,7 +97,7 @@ Podman 采用无守护进程的包容性架构,因此可以更安全、更简
2. 拉取新版本镜像

```bash
podman pull halohub/halo:2.12
podman pull halohub/halo:2.13
```

3. 停止运行中的容器
Expand All @@ -112,7 +112,7 @@ Podman 采用无守护进程的包容性架构,因此可以更安全、更简
修改版本号后,按照最初安装的方式,重新创建容器即可。

```bash
podman run -it -d --name halo -p 8090:8090 -v ~/.halo2:/root/.halo2 halohub/halo:2.12
podman run -it -d --name halo -p 8090:8090 -v ~/.halo2:/root/.halo2 halohub/halo:2.13
```

## 使用 [Podman Quadlet](https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html)
Expand Down Expand Up @@ -148,7 +148,7 @@ Podman 没有和 Docker 类似的管理进程,在低配置的主机上更友
Environment=TZ=Asia/Shanghai
Volume=/opt/podman-data/halo:/.halo
PublishPort=127.0.0.1:8090:8090
Image=ghcr.io/halo-dev/halo:2.12
Image=ghcr.io/halo-dev/halo:2.13
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 --halo.cache.page.disabled=false

[Service]
Expand Down Expand Up @@ -177,7 +177,7 @@ Podman Quadlet 解析:

`[Container]` 部分:

- `AutoUpdate=registry`指定了自动拉取容器。假设后续Halo镜像支持了`latest`标签,你需要`systemctl enable --now podman-auto-update.timer`以启用容器自动更新。本文示例`ghcr.io/halo-dev/halo:2.12`,将会自动更新适用与`2.12`版本的patch,例如您创建容器时是`2.12.1`,在官方发布`2.12.2`版本时,容器会自动更新到`2.12.2`。
- `AutoUpdate=registry`指定了自动拉取容器。假设后续Halo镜像支持了`latest`标签,你需要`systemctl enable --now podman-auto-update.timer`以启用容器自动更新。本文示例`ghcr.io/halo-dev/halo:2.13`,将会自动更新适用与`2.13`版本的patch,例如您创建容器时是`2.13.1`,在官方发布`2.13.2`版本时,容器会自动更新到`2.13.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`路径。
Expand Down Expand Up @@ -220,7 +220,7 @@ Podman Quadlet 解析:
ContainerName=halo
Volume=/opt/podman-data/halo:/root/.halo
PublishPort=127.0.0.1:8090:8090
Image=ghcr.io/halo-dev/halo:2.12
Image=ghcr.io/halo-dev/halo:2.13
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 --halo.cache.page.disabled=false

[Service]
Expand Down
2 changes: 1 addition & 1 deletion docs/intro.md
Expand Up @@ -34,7 +34,7 @@ slug: /
## 快速开始

```bash
docker run -it -d --name halo -p 8090:8090 -v ~/.halo2:/root/.halo2 halohub/halo:2.12
docker run -it -d --name halo -p 8090:8090 -v ~/.halo2:/root/.halo2 halohub/halo:2.13
```

以上仅作为体验使用,详细部署文档请查阅:<https://docs.halo.run/getting-started/install/docker-compose>
Expand Down
4 changes: 2 additions & 2 deletions docs/user-guide/faq.md
Expand Up @@ -93,15 +93,15 @@ server {
--name halo-1 \
-p 8090:8090 \
-v ~/.halo2:/root/.halo2 \
halohub/halo:2.12 \
halohub/halo:2.13 \

# 第二个 Halo 容器
docker run \
-it -d \
--name halo-2 \
-p 8091:8090 \
-v ~/.halo2_2:/root/.halo2 \
halohub/halo:2.12 \
halohub/halo:2.13 \
```

更多 Docker 相关的教程请参考:[使用 Docker 部署 Halo](../getting-started/install/docker.md)
Expand Down
35 changes: 18 additions & 17 deletions docusaurus.config.js
Expand Up @@ -27,11 +27,11 @@ const config = {
routeBasePath: "/",
showLastUpdateTime: true,
showLastUpdateAuthor: true,
lastVersion: "2.12",
lastVersion: "2.13",
versions: {
current: {
label: "2.13.0-SNAPSHOT",
path: "2.13.0-SNAPSHOT",
label: "2.14.0-SNAPSHOT",
path: "2.14.0-SNAPSHOT",
},
},
},
Expand Down Expand Up @@ -235,21 +235,22 @@ const config = {
},
],
createRedirects(existingPath) {
if (existingPath.startsWith("/2.13.0-SNAPSHOT/")) {
if (existingPath.startsWith("/2.14.0-SNAPSHOT/")) {
return [
existingPath.replace("/2.13.0-SNAPSHOT/", "/2.0.0-SNAPSHOT/"),
existingPath.replace("/2.13.0-SNAPSHOT/", "/2.1.0-SNAPSHOT/"),
existingPath.replace("/2.13.0-SNAPSHOT/", "/2.2.0-SNAPSHOT/"),
existingPath.replace("/2.13.0-SNAPSHOT/", "/2.3.0-SNAPSHOT/"),
existingPath.replace("/2.13.0-SNAPSHOT/", "/2.4.0-SNAPSHOT/"),
existingPath.replace("/2.13.0-SNAPSHOT/", "/2.5.0-SNAPSHOT/"),
existingPath.replace("/2.13.0-SNAPSHOT/", "/2.6.0-SNAPSHOT/"),
existingPath.replace("/2.13.0-SNAPSHOT/", "/2.7.0-SNAPSHOT/"),
existingPath.replace("/2.13.0-SNAPSHOT/", "/2.8.0-SNAPSHOT/"),
existingPath.replace("/2.13.0-SNAPSHOT/", "/2.9.0-SNAPSHOT/"),
existingPath.replace("/2.13.0-SNAPSHOT/", "/2.10.0-SNAPSHOT/"),
existingPath.replace("/2.13.0-SNAPSHOT/", "/2.11.0-SNAPSHOT/"),
existingPath.replace("/2.13.0-SNAPSHOT/", "/2.12.0-SNAPSHOT/"),
existingPath.replace("/2.14.0-SNAPSHOT/", "/2.0.0-SNAPSHOT/"),
existingPath.replace("/2.14.0-SNAPSHOT/", "/2.1.0-SNAPSHOT/"),
existingPath.replace("/2.14.0-SNAPSHOT/", "/2.2.0-SNAPSHOT/"),
existingPath.replace("/2.14.0-SNAPSHOT/", "/2.3.0-SNAPSHOT/"),
existingPath.replace("/2.14.0-SNAPSHOT/", "/2.4.0-SNAPSHOT/"),
existingPath.replace("/2.14.0-SNAPSHOT/", "/2.5.0-SNAPSHOT/"),
existingPath.replace("/2.14.0-SNAPSHOT/", "/2.6.0-SNAPSHOT/"),
existingPath.replace("/2.14.0-SNAPSHOT/", "/2.7.0-SNAPSHOT/"),
existingPath.replace("/2.14.0-SNAPSHOT/", "/2.8.0-SNAPSHOT/"),
existingPath.replace("/2.14.0-SNAPSHOT/", "/2.9.0-SNAPSHOT/"),
existingPath.replace("/2.14.0-SNAPSHOT/", "/2.10.0-SNAPSHOT/"),
existingPath.replace("/2.14.0-SNAPSHOT/", "/2.11.0-SNAPSHOT/"),
existingPath.replace("/2.14.0-SNAPSHOT/", "/2.12.0-SNAPSHOT/"),
existingPath.replace("/2.14.0-SNAPSHOT/", "/2.13.0-SNAPSHOT/"),
];
}
return undefined;
Expand Down
14 changes: 7 additions & 7 deletions i18n/zh-Hans/code.json
Expand Up @@ -236,10 +236,6 @@
"message": "文档侧边栏",
"description": "The ARIA label for the sidebar navigation"
},
"theme.docs.sidebar.closeSidebarButtonAriaLabel": {
"message": "关闭导航栏",
"description": "The ARIA label for close button of mobile sidebar"
},
"theme.docs.sidebar.collapseButtonTitle": {
"message": "收起侧边栏",
"description": "The title attribute for collapse button of doc sidebar"
Expand All @@ -248,14 +244,18 @@
"message": "收起侧边栏",
"description": "The title attribute for collapse button of doc sidebar"
},
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": {
"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.closeSidebarButtonAriaLabel": {
"message": "关闭导航栏",
"description": "The ARIA label for close button of mobile sidebar"
},
"theme.docs.sidebar.toggleSidebarButtonAriaLabel": {
"message": "切换导航栏",
"description": "The ARIA label for hamburger menu button of mobile navigation"
},
"theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": {
"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.expandButtonTitle": {
"message": "展开侧边栏",
"description": "The ARIA label and title attribute for expand button of doc sidebar"
Expand Down