From 48d2ce43df34a2ace6982bd63c5e5139e6897785 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Fri, 19 Apr 2024 09:22:07 +0800 Subject: [PATCH] docs: update example of theme manifest file (#338) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新主题开发中的 theme.yaml 示例。 Ref https://github.com/halo-dev/halo/issues/5721 ```release-note None ``` --- docs/developer-guide/theme/config.md | 42 ++++++++++--------- docs/developer-guide/theme/prepare.md | 14 ++++--- docs/developer-guide/theme/settings.md | 13 +++--- .../developer-guide/theme/config.md | 42 ++++++++++--------- .../developer-guide/theme/prepare.md | 14 ++++--- .../developer-guide/theme/settings.md | 13 +++--- 6 files changed, 80 insertions(+), 58 deletions(-) diff --git a/docs/developer-guide/theme/config.md b/docs/developer-guide/theme/config.md index 6827c8d..77b376e 100644 --- a/docs/developer-guide/theme/config.md +++ b/docs/developer-guide/theme/config.md @@ -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.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` | 协议 | 否 | ## 更新配置 diff --git a/docs/developer-guide/theme/prepare.md b/docs/developer-guide/theme/prepare.md index 911ad3b..f58b203 100644 --- a/docs/developer-guide/theme/prepare.md +++ b/docs/developer-guide/theme/prepare.md @@ -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 提示 diff --git a/docs/developer-guide/theme/settings.md b/docs/developer-guide/theme/settings.md index b0bb850..afd8912 100644 --- a/docs/developer-guide/theme/settings.md +++ b/docs/developer-guide/theme/settings.md @@ -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 diff --git a/versioned_docs/version-2.14/developer-guide/theme/config.md b/versioned_docs/version-2.14/developer-guide/theme/config.md index 6827c8d..77b376e 100644 --- a/versioned_docs/version-2.14/developer-guide/theme/config.md +++ b/versioned_docs/version-2.14/developer-guide/theme/config.md @@ -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.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` | 协议 | 否 | ## 更新配置 diff --git a/versioned_docs/version-2.14/developer-guide/theme/prepare.md b/versioned_docs/version-2.14/developer-guide/theme/prepare.md index 911ad3b..f58b203 100644 --- a/versioned_docs/version-2.14/developer-guide/theme/prepare.md +++ b/versioned_docs/version-2.14/developer-guide/theme/prepare.md @@ -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 提示 diff --git a/versioned_docs/version-2.14/developer-guide/theme/settings.md b/versioned_docs/version-2.14/developer-guide/theme/settings.md index b0bb850..afd8912 100644 --- a/versioned_docs/version-2.14/developer-guide/theme/settings.md +++ b/versioned_docs/version-2.14/developer-guide/theme/settings.md @@ -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