docs: update example of theme manifest file (#338)

更新主题开发中的 theme.yaml 示例。

Ref https://github.com/halo-dev/halo/issues/5721

```release-note
None
```
wan92hen-patch-1
Ryan Wang 7 months ago committed by GitHub
parent 1bb91bec16
commit 48d2ce43df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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"
@ -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.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.requires` | 所需 Halo 的运行版本 | 是 |
| `spec.license` | 协议 | 否 |
## 更新配置

@ -21,6 +21,7 @@ Halo 在本地开发环境的运行可参考[开发环境运行](../core/run.md)
```
- 使用 Docker 运行时,需要添加 `SPRING_THYMELEAF_CACHE=false` 的环境变量。
:::
## 新建一个主题
@ -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 提示

@ -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

@ -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"
@ -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.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.requires` | 所需 Halo 的运行版本 | 是 |
| `spec.license` | 协议 | 否 |
## 更新配置

@ -21,6 +21,7 @@ Halo 在本地开发环境的运行可参考[开发环境运行](../core/run.md)
```
- 使用 Docker 运行时,需要添加 `SPRING_THYMELEAF_CACHE=false` 的环境变量。
:::
## 新建一个主题
@ -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 提示

@ -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

Loading…
Cancel
Save