Skip to content

Commit

Permalink
docs: update example of theme manifest file (#338)
Browse files Browse the repository at this point in the history
更新主题开发中的 theme.yaml 示例。

Ref halo-dev/halo#5721

```release-note
None
```
  • Loading branch information
ruibaby committed Apr 19, 2024
1 parent 1bb91be commit 48d2ce4
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 58 deletions.
42 changes: 23 additions & 19 deletions docs/developer-guide/theme/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ metadata:
spec:
displayName: 示例主题
author:
name: halo-dev
website: https://halo.run
name: Halo
website: https://www.halo.run
description: 一个示例主题
logo: https://halo.run/logo
website: https://github.com/halo-sigs/theme-foo
logo: https://www.halo.run/logo
homepage: https://github.com/halo-sigs/theme-foo
repo: https://github.com/halo-sigs/theme-foo.git
settingName: "theme-foo-setting"
configMapName: "theme-foo-configMap"
Expand All @@ -40,28 +40,32 @@ spec:
screenshot:
file: page_about.html
version: 1.0.0
require: 2.0.0
requires: 2.0.0
license:
- name: "GPL-3.0"
url: "https://github.com/halo-sigs/theme-foo/blob/main/LICENSE"
```

## 字段详解

| 字段 | 描述 | 是否必填 |
| ------------------------------- | ----------------------------------------------------------------------------- | -------- |
| `metadata.name` | 主题的唯一标识 ||
| `spec.displayName` | 显示名称 ||
| `spec.author.name` | 作者名称 ||
| `spec.author.website` | 作者网站 ||
| `spec.description` | 主题描述 ||
| `spec.logo` | 主题 Logo ||
| `spec.website` | 主题网站 ||
| `spec.repo` | 主题托管地址 ||
| `spec.settingName` | 设置表单定义的名称,需要同时创建对应的 `settings.yaml` 文件 ||
| `spec.configMapName` | 设置持久化配置的 ConfigMap 名称 ||
| 字段 | 描述 | 是否必填 |
|---------------------------------|---------------------------------------------------------------------------------------------|---------|
| `metadata.name` | 主题的唯一标识 ||
| `spec.displayName` | 显示名称 ||
| `spec.author.name` | 作者名称 ||
| `spec.author.website` | 作者网站 ||
| `spec.description` | 主题描述 ||
| `spec.logo` | 主题 Logo ||
| `spec.homepage` | 主题网站 ||
| `spec.repo` | 主题代码托管地址 ||
| `spec.settingName` | 设置表单定义的名称,需要同时创建对应的 `settings.yaml` 文件 ||
| `spec.configMapName` | 设置持久化配置的 ConfigMap 名称 ||
| `spec.customTemplates.post` | 文章的自定义模板配置,详细文档可查阅 [模板路由](./template-route-mapping#custom-templates) ||
| `spec.customTemplates.category` | 分类的自定义模板配置,详细文档可查阅 [模板路由](./template-route-mapping#custom-templates) ||
| `spec.customTemplates.page` | 独立页面的自定义模板配置,详细文档可查阅 [模板路由](./template-route-mapping#custom-templates) ||
| `spec.version` | 主题版本 ||
| `spec.require` | 所需 Halo 的运行版本 ||
| `spec.version` | 主题版本 ||
| `spec.requires` | 所需 Halo 的运行版本 ||
| `spec.license` | 协议 ||

## 更新配置

Expand Down
14 changes: 9 additions & 5 deletions docs/developer-guide/theme/prepare.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Halo 在本地开发环境的运行可参考[开发环境运行](../core/run.md)
```

- 使用 Docker 运行时,需要添加 `SPRING_THYMELEAF_CACHE=false` 的环境变量。

:::

## 新建一个主题
Expand All @@ -35,16 +36,19 @@ metadata:
spec:
displayName: 示例主题
author:
name: halo-dev
website: https://halo.run
name: Halo
website: https://www.halo.run
description: 一个示例主题
logo: https://halo.run/logo
website: https://github.com/halo-sigs/theme-foo
logo: https://www.halo.run/logo
homepage: https://github.com/halo-sigs/theme-foo
repo: https://github.com/halo-sigs/theme-foo.git
settingName: "theme-foo-setting"
configMapName: "theme-foo-configMap"
version: 1.0.0
require: 2.0.0
requires: 2.0.0
license:
- name: "GPL-3.0"
url: "https://github.com/halo-sigs/theme-foo/blob/main/LICENSE"
```

:::info 提示
Expand Down
13 changes: 8 additions & 5 deletions docs/developer-guide/theme/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,19 @@ metadata:
spec:
displayName: 示例主题
author:
name: halo-dev
website: https://halo.run
name: Halo
website: https://www.halo.run
description: 一个示例主题
logo: https://halo.run/logo
website: https://github.com/halo-sigs/theme-foo
logo: https://www.halo.run/logo
homepage: https://github.com/halo-sigs/theme-foo
repo: https://github.com/halo-sigs/theme-foo.git
settingName: "theme-foo-setting"
configMapName: "theme-foo-configMap"
version: 1.0.0
require: 2.0.0
requires: 2.0.0
license:
- name: "GPL-3.0"
url: "https://github.com/halo-sigs/theme-foo/blob/main/LICENSE"
```

:::tip
Expand Down
42 changes: 23 additions & 19 deletions versioned_docs/version-2.14/developer-guide/theme/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ metadata:
spec:
displayName: 示例主题
author:
name: halo-dev
website: https://halo.run
name: Halo
website: https://www.halo.run
description: 一个示例主题
logo: https://halo.run/logo
website: https://github.com/halo-sigs/theme-foo
logo: https://www.halo.run/logo
homepage: https://github.com/halo-sigs/theme-foo
repo: https://github.com/halo-sigs/theme-foo.git
settingName: "theme-foo-setting"
configMapName: "theme-foo-configMap"
Expand All @@ -40,28 +40,32 @@ spec:
screenshot:
file: page_about.html
version: 1.0.0
require: 2.0.0
requires: 2.0.0
license:
- name: "GPL-3.0"
url: "https://github.com/halo-sigs/theme-foo/blob/main/LICENSE"
```

## 字段详解

| 字段 | 描述 | 是否必填 |
| ------------------------------- | ----------------------------------------------------------------------------- | -------- |
| `metadata.name` | 主题的唯一标识 ||
| `spec.displayName` | 显示名称 ||
| `spec.author.name` | 作者名称 ||
| `spec.author.website` | 作者网站 ||
| `spec.description` | 主题描述 ||
| `spec.logo` | 主题 Logo ||
| `spec.website` | 主题网站 ||
| `spec.repo` | 主题托管地址 ||
| `spec.settingName` | 设置表单定义的名称,需要同时创建对应的 `settings.yaml` 文件 ||
| `spec.configMapName` | 设置持久化配置的 ConfigMap 名称 ||
| 字段 | 描述 | 是否必填 |
|---------------------------------|---------------------------------------------------------------------------------------------|---------|
| `metadata.name` | 主题的唯一标识 ||
| `spec.displayName` | 显示名称 ||
| `spec.author.name` | 作者名称 ||
| `spec.author.website` | 作者网站 ||
| `spec.description` | 主题描述 ||
| `spec.logo` | 主题 Logo ||
| `spec.homepage` | 主题网站 ||
| `spec.repo` | 主题代码托管地址 ||
| `spec.settingName` | 设置表单定义的名称,需要同时创建对应的 `settings.yaml` 文件 ||
| `spec.configMapName` | 设置持久化配置的 ConfigMap 名称 ||
| `spec.customTemplates.post` | 文章的自定义模板配置,详细文档可查阅 [模板路由](./template-route-mapping#custom-templates) ||
| `spec.customTemplates.category` | 分类的自定义模板配置,详细文档可查阅 [模板路由](./template-route-mapping#custom-templates) ||
| `spec.customTemplates.page` | 独立页面的自定义模板配置,详细文档可查阅 [模板路由](./template-route-mapping#custom-templates) ||
| `spec.version` | 主题版本 ||
| `spec.require` | 所需 Halo 的运行版本 ||
| `spec.version` | 主题版本 ||
| `spec.requires` | 所需 Halo 的运行版本 ||
| `spec.license` | 协议 ||

## 更新配置

Expand Down
14 changes: 9 additions & 5 deletions versioned_docs/version-2.14/developer-guide/theme/prepare.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Halo 在本地开发环境的运行可参考[开发环境运行](../core/run.md)
```

- 使用 Docker 运行时,需要添加 `SPRING_THYMELEAF_CACHE=false` 的环境变量。

:::

## 新建一个主题
Expand All @@ -35,16 +36,19 @@ metadata:
spec:
displayName: 示例主题
author:
name: halo-dev
website: https://halo.run
name: Halo
website: https://www.halo.run
description: 一个示例主题
logo: https://halo.run/logo
website: https://github.com/halo-sigs/theme-foo
logo: https://www.halo.run/logo
homepage: https://github.com/halo-sigs/theme-foo
repo: https://github.com/halo-sigs/theme-foo.git
settingName: "theme-foo-setting"
configMapName: "theme-foo-configMap"
version: 1.0.0
require: 2.0.0
requires: 2.0.0
license:
- name: "GPL-3.0"
url: "https://github.com/halo-sigs/theme-foo/blob/main/LICENSE"
```

:::info 提示
Expand Down
13 changes: 8 additions & 5 deletions versioned_docs/version-2.14/developer-guide/theme/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,19 @@ metadata:
spec:
displayName: 示例主题
author:
name: halo-dev
website: https://halo.run
name: Halo
website: https://www.halo.run
description: 一个示例主题
logo: https://halo.run/logo
website: https://github.com/halo-sigs/theme-foo
logo: https://www.halo.run/logo
homepage: https://github.com/halo-sigs/theme-foo
repo: https://github.com/halo-sigs/theme-foo.git
settingName: "theme-foo-setting"
configMapName: "theme-foo-configMap"
version: 1.0.0
require: 2.0.0
requires: 2.0.0
license:
- name: "GPL-3.0"
url: "https://github.com/halo-sigs/theme-foo/blob/main/LICENSE"
```

:::tip
Expand Down

0 comments on commit 48d2ce4

Please sign in to comment.