Skip to content

Commit

Permalink
docs: update documentation for Halo 2.17 (halo-dev#378)
Browse files Browse the repository at this point in the history
为 [Halo 2.17](https://github.com/halo-dev/halo/releases/tag/v2.17.0) 更新文档。

/kind documentation

```release-note
None
```
  • Loading branch information
ruibaby authored and guqing committed Aug 1, 2024
1 parent d61ebe4 commit 222471b
Show file tree
Hide file tree
Showing 174 changed files with 14,350 additions and 73 deletions.
2 changes: 1 addition & 1 deletion docs/developer-guide/core/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ git checkout ${branch_name}

## 构建 Fat Jar

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

```bash
cd path/to/halo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,16 @@ FieldSelector.of(QueryFactory.and(

`FieldSelector` 中使用的所有字段都必须添加为索引,否则会抛出异常表示不支持该字段。关于如何使用索引请参考 [自定义模型使用索引](./extension.md#using-indexes)

:::info
以下是自定义模型在注册后自动生成的默认索引字段,无需手动添加索引即可直接使用:

- `metadata.name`:自定义模型的名称对应的索引名,使用示例: `Sort.Order.asc("metadata.name")`
- `metadata.creationTimestamp`:自定义模型的创建时间对应的索引名。
- `metadata.deletionTimestamp`:自定义模型的删除时间对应的索引名。
- `metadata.labels`:自定义模型的标签对应的索引名,可用于 LabelSelector 查询。

:::

可以通过 `and``or` 方法组合和嵌套查询条件:

```java
Expand Down
12 changes: 6 additions & 6 deletions docs/getting-started/install/docker-compose.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import DockerRegistryList from "./slots/_docker-registry-list.md"
services:
halo:
image: registry.fit2cloud.com/halo/halo:2.16
image: registry.fit2cloud.com/halo/halo:2.17
restart: on-failure:3
depends_on:
halodb:
Expand Down Expand Up @@ -106,7 +106,7 @@ import DockerRegistryList from "./slots/_docker-registry-list.md"
services:
halo:
image: registry.fit2cloud.com/halo/halo:2.16
image: registry.fit2cloud.com/halo/halo:2.17
restart: on-failure:3
depends_on:
halodb:
Expand Down Expand Up @@ -174,7 +174,7 @@ import DockerRegistryList from "./slots/_docker-registry-list.md"
services:
halo:
image: registry.fit2cloud.com/halo/halo:2.16
image: registry.fit2cloud.com/halo/halo:2.17
restart: on-failure:3
volumes:
- ./halo2:/root/.halo2
Expand All @@ -198,7 +198,7 @@ import DockerRegistryList from "./slots/_docker-registry-list.md"
services:
halo:
image: registry.fit2cloud.com/halo/halo:2.16
image: registry.fit2cloud.com/halo/halo:2.17
restart: on-failure:3
network_mode: "host"
volumes:
Expand Down Expand Up @@ -247,7 +247,7 @@ import DockerRegistryList from "./slots/_docker-registry-list.md"
```yaml {3}
services:
halo:
image: registry.fit2cloud.com/halo/halo:2.16
image: registry.fit2cloud.com/halo/halo:2.17
```

```bash
Expand Down Expand Up @@ -311,7 +311,7 @@ networks:
services:
halo:
image: registry.fit2cloud.com/halo/halo:2.16
image: registry.fit2cloud.com/halo/halo:2.17
restart: on-failure:3
volumes:
- ./halo2:/root/.halo2
Expand Down
6 changes: 3 additions & 3 deletions docs/getting-started/install/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.16
docker run -it -d --name halo -p 8090:8090 -v ~/.halo2:/root/.halo2 registry.fit2cloud.com/halo/halo:2.17
```

:::info
Expand Down Expand Up @@ -60,7 +60,7 @@ import DockerRegistryList from "./slots/_docker-registry-list.md"
2. 拉取新版本镜像

```bash
docker pull registry.fit2cloud.com/halo/halo:2.16
docker pull registry.fit2cloud.com/halo/halo:2.17
```

3. 停止运行中的容器
Expand All @@ -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.16
docker run -it -d --name halo -p 8090:8090 -v ~/.halo2:/root/.halo2 registry.fit2cloud.com/halo/halo:2.17
```
4 changes: 2 additions & 2 deletions docs/getting-started/install/jar-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ title: 使用 JAR 文件部署
3. 下载运行包

```bash
wget https://dl.halo.run/release/halo-2.16.0.jar -O halo.jar
wget https://dl.halo.run/release/halo-2.17.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.16.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 服务
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/install/other/traefik.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ networks:
services:
halo:
image: registry.fit2cloud.com/halo/halo:2.16
image: registry.fit2cloud.com/halo/halo:2.17
container_name: halo
restart: on-failure:3
volumes:
Expand Down
12 changes: 6 additions & 6 deletions docs/getting-started/install/podman.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.16
podman run -it -d --name halo -p 8090:8090 -v ~/.halo2:/root/.halo2 registry.fit2cloud.com/halo/halo:2.17
```

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

```bash
podman pull registry.fit2cloud.com/halo/halo:2.16
podman pull registry.fit2cloud.com/halo/halo:2.17
```

3. 停止运行中的容器
Expand All @@ -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.16
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)
Expand Down Expand Up @@ -137,7 +137,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.16
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]
Expand Down Expand Up @@ -166,7 +166,7 @@ Podman Quadlet 解析:

`[Container]` 部分:

- `AutoUpdate=registry`指定了自动拉取容器。假设后续Halo镜像支持了`latest`标签,你需要`systemctl enable --now podman-auto-update.timer`以启用容器自动更新。本文示例`ghcr.io/halo-dev/halo:2.16`,将会自动更新适用与`2.16`版本的patch,例如您创建容器时是`2.16.1`,在官方发布`2.16.2`版本时,容器会自动更新到`2.16.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`路径。
Expand Down Expand Up @@ -209,7 +209,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.16
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]
Expand Down
8 changes: 4 additions & 4 deletions docs/getting-started/install/slots/_docker-registry-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.16` 或者 `2.16.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.16`:表示最新的 2.16.x 版本,即每次发布 patch 版本都会同时更新此镜像。
- `registry.fit2cloud.com/halo/halo:2.16.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.16` 为例。
后续文档以 `registry.fit2cloud.com/halo/halo:2.17` 为例。
:::
2 changes: 1 addition & 1 deletion docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ slug: /
## 快速开始

```bash
docker run -d --name halo -p 8090:8090 -v ~/.halo2:/root/.halo2 halohub/halo:2.16
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>
Expand Down
4 changes: 2 additions & 2 deletions docs/user-guide/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,15 @@ server {
--name halo-1 \
-p 8090:8090 \
-v ~/.halo2:/root/.halo2 \
registry.fit2cloud.com/halo/halo:2.16 \
registry.fit2cloud.com/halo/halo:2.17 \
# 第二个 Halo 容器
docker run \
-it -d \
--name halo-2 \
-p 8091:8090 \
-v ~/.halo2_2:/root/.halo2 \
registry.fit2cloud.com/halo/halo:2.16 \
registry.fit2cloud.com/halo/halo:2.17 \
```

更多 Docker 相关的教程请参考:[使用 Docker 部署 Halo](../getting-started/install/docker.md)
Expand Down
23 changes: 12 additions & 11 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ const config = {
routeBasePath: "/",
showLastUpdateTime: true,
showLastUpdateAuthor: true,
lastVersion: "2.16",
lastVersion: "2.17",
versions: {
current: {
label: "2.17.0-SNAPSHOT",
path: "2.17.0-SNAPSHOT",
label: "2.18.0-SNAPSHOT",
path: "2.18.0-SNAPSHOT",
},
},
},
Expand Down Expand Up @@ -234,15 +234,16 @@ const config = {
},
],
createRedirects(existingPath) {
if (existingPath.startsWith("/2.17.0-SNAPSHOT/")) {
if (existingPath.startsWith("/2.18.0-SNAPSHOT/")) {
return [
existingPath.replace("/2.17.0-SNAPSHOT/", "/2.10.0-SNAPSHOT/"),
existingPath.replace("/2.17.0-SNAPSHOT/", "/2.11.0-SNAPSHOT/"),
existingPath.replace("/2.17.0-SNAPSHOT/", "/2.12.0-SNAPSHOT/"),
existingPath.replace("/2.17.0-SNAPSHOT/", "/2.13.0-SNAPSHOT/"),
existingPath.replace("/2.17.0-SNAPSHOT/", "/2.14.0-SNAPSHOT/"),
existingPath.replace("/2.17.0-SNAPSHOT/", "/2.15.0-SNAPSHOT/"),
existingPath.replace("/2.17.0-SNAPSHOT/", "/2.16.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;
Expand Down
Loading

0 comments on commit 222471b

Please sign in to comment.