Skip to content

Commit

Permalink
fix: correct getByNames method examples for category and tag api (#483)
Browse files Browse the repository at this point in the history
修复 categoryFinder 和 tagFinder 关于 getByNames 的错误示例。

Fixes #475

```release-note
None
```
  • Loading branch information
ruibaby authored Dec 9, 2024
1 parent ccde5aa commit ec9fdde
Show file tree
Hide file tree
Showing 18 changed files with 50 additions and 18 deletions.
10 changes: 9 additions & 1 deletion docs/developer-guide/theme/finder-apis/category.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import CategoryTreeVo from "../vo/_CategoryTreeVo.md"
categoryFinder.getByName(name)
```

:::info 提示
通常建议配合 [主题设置](../settings.md)[分类选择器](../../form-schema.md#categoryselect) 使用,让用户自行选择所需的分类。
:::

### 描述

根据 `metadata.name` 获取文章分类。
Expand All @@ -38,6 +42,10 @@ categoryFinder.getByName(name)
categoryFinder.getByNames(names)
```

:::info 提示
通常建议配合 [主题设置](../settings.md)[分类选择器](../../form-schema.md#categoryselect) 使用,让用户自行选择所需的分类。
:::

### 描述

根据一组 `metadata.name` 获取文章分类。
Expand All @@ -53,7 +61,7 @@ List\<[#CategoryVo](#categoryvo)\>
### 示例

```html
<div th:with="categories = ${categoryFinder.getByNames(['category-foo', 'category-bar'])}">
<div th:with="categories = ${categoryFinder.getByNames({'category-foo', 'category-bar'})}">
<a th:each="category : ${categories}" th:href="@{${category.status.permalink}}" th:text="${category.spec.displayName}"></a>
</div>
```
Expand Down
2 changes: 1 addition & 1 deletion docs/developer-guide/theme/finder-apis/contributor.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ List\<[#ContributorVo](#contributorvo)\>
### 示例

```html
<div th:with="contributors = ${contributorFinder.getContributors(['contributor-foo, 'contributor-bar'])}">
<div th:with="contributors = ${contributorFinder.getContributors({'contributor-foo, 'contributor-bar'})}">
<span th:each="contributor : ${contributors}" th:text="${contributor.displayName}"></span>
</div>
```
Expand Down
10 changes: 9 additions & 1 deletion docs/developer-guide/theme/finder-apis/tag.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import TagVo from "../vo/_TagVo.md"
tagFinder.getByName(name)
```

:::info 提示
通常建议配合 [主题设置](../settings.md)[标签选择器](../../form-schema.md#tagselect) 使用,让用户自行选择所需的标签。
:::

### 描述

根据 `metadata.name` 获取标签。
Expand All @@ -37,6 +41,10 @@ tagFinder.getByName(name)
tagFinder.getByNames(names)
```

:::info 提示
通常建议配合 [主题设置](../settings.md)[标签选择器](../../form-schema.md#tagselect) 使用,让用户自行选择所需的标签。
:::

### 描述

根据一组 `metadata.name` 获取标签。
Expand All @@ -52,7 +60,7 @@ List\<[#TagVo](#tagvo)\>
### 示例

```html
<div th:with="tags = ${tagFinder.getByNames(['tag-foo', 'tag-bar'])}">
<div th:with="tags = ${tagFinder.getByNames({'tag-foo', 'tag-bar'})}">
<a th:each="tag : ${tags}" th:href="@{${tag.status.permalink}}" th:text="${tag.spec.displayName}"></a>
</div>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ List\<[#CategoryVo](#categoryvo)\>
### 示例

```html
<div th:with="categories = ${categoryFinder.getByNames(['category-foo', 'category-bar'])}">
<div th:with="categories = ${categoryFinder.getByNames({'category-foo', 'category-bar'})}">
<a th:each="category : ${categories}" th:href="@{${category.status.permalink}}" th:text="${category.spec.displayName}"></a>
</div>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ List\<[#ContributorVo](#contributorvo)\>
### 示例

```html
<div th:with="contributors = ${contributorFinder.getContributors(['contributor-foo, 'contributor-bar'])}">
<div th:with="contributors = ${contributorFinder.getContributors({'contributor-foo, 'contributor-bar'})}">
<span th:each="contributor : ${contributors}" th:text="${contributor.displayName}"></span>
</div>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ List\<[#TagVo](#tagvo)\>
### 示例

```html
<div th:with="tags = ${tagFinder.getByNames(['tag-foo', 'tag-bar'])}">
<div th:with="tags = ${tagFinder.getByNames({'tag-foo', 'tag-bar'})}">
<a th:each="tag : ${tags}" th:href="@{${tag.status.permalink}}" th:text="${tag.spec.displayName}"></a>
</div>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ List\<[#CategoryVo](#categoryvo)\>
### 示例

```html
<div th:with="categories = ${categoryFinder.getByNames(['category-foo', 'category-bar'])}">
<div th:with="categories = ${categoryFinder.getByNames({'category-foo', 'category-bar'})}">
<a th:each="category : ${categories}" th:href="@{${category.status.permalink}}" th:text="${category.spec.displayName}"></a>
</div>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ List\<[#ContributorVo](#contributorvo)\>
### 示例

```html
<div th:with="contributors = ${contributorFinder.getContributors(['contributor-foo, 'contributor-bar'])}">
<div th:with="contributors = ${contributorFinder.getContributors({'contributor-foo, 'contributor-bar'})}">
<span th:each="contributor : ${contributors}" th:text="${contributor.displayName}"></span>
</div>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ List\<[#TagVo](#tagvo)\>
### 示例

```html
<div th:with="tags = ${tagFinder.getByNames(['tag-foo', 'tag-bar'])}">
<div th:with="tags = ${tagFinder.getByNames({'tag-foo', 'tag-bar'})}">
<a th:each="tag : ${tags}" th:href="@{${tag.status.permalink}}" th:text="${tag.spec.displayName}"></a>
</div>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ List\<[#CategoryVo](#categoryvo)\>
### 示例

```html
<div th:with="categories = ${categoryFinder.getByNames(['category-foo', 'category-bar'])}">
<div th:with="categories = ${categoryFinder.getByNames({'category-foo', 'category-bar'})}">
<a th:each="category : ${categories}" th:href="@{${category.status.permalink}}" th:text="${category.spec.displayName}"></a>
</div>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ List\<[#ContributorVo](#contributorvo)\>
### 示例

```html
<div th:with="contributors = ${contributorFinder.getContributors(['contributor-foo, 'contributor-bar'])}">
<div th:with="contributors = ${contributorFinder.getContributors({'contributor-foo, 'contributor-bar'})}">
<span th:each="contributor : ${contributors}" th:text="${contributor.displayName}"></span>
</div>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ List\<[#TagVo](#tagvo)\>
### 示例

```html
<div th:with="tags = ${tagFinder.getByNames(['tag-foo', 'tag-bar'])}">
<div th:with="tags = ${tagFinder.getByNames({'tag-foo', 'tag-bar'})}">
<a th:each="tag : ${tags}" th:href="@{${tag.status.permalink}}" th:text="${tag.spec.displayName}"></a>
</div>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ List\<[#CategoryVo](#categoryvo)\>
### 示例

```html
<div th:with="categories = ${categoryFinder.getByNames(['category-foo', 'category-bar'])}">
<div th:with="categories = ${categoryFinder.getByNames({'category-foo', 'category-bar'})}">
<a th:each="category : ${categories}" th:href="@{${category.status.permalink}}" th:text="${category.spec.displayName}"></a>
</div>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ List\<[#ContributorVo](#contributorvo)\>
### 示例

```html
<div th:with="contributors = ${contributorFinder.getContributors(['contributor-foo, 'contributor-bar'])}">
<div th:with="contributors = ${contributorFinder.getContributors({'contributor-foo, 'contributor-bar'})}">
<span th:each="contributor : ${contributors}" th:text="${contributor.displayName}"></span>
</div>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ List\<[#TagVo](#tagvo)\>
### 示例

```html
<div th:with="tags = ${tagFinder.getByNames(['tag-foo', 'tag-bar'])}">
<div th:with="tags = ${tagFinder.getByNames({'tag-foo', 'tag-bar'})}">
<a th:each="tag : ${tags}" th:href="@{${tag.status.permalink}}" th:text="${tag.spec.displayName}"></a>
</div>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import CategoryTreeVo from "../vo/_CategoryTreeVo.md"
categoryFinder.getByName(name)
```

:::info 提示
通常建议配合 [主题设置](../settings.md)[分类选择器](../../form-schema.md#categoryselect) 使用,让用户自行选择所需的分类。
:::

### 描述

根据 `metadata.name` 获取文章分类。
Expand All @@ -38,6 +42,10 @@ categoryFinder.getByName(name)
categoryFinder.getByNames(names)
```

:::info 提示
通常建议配合 [主题设置](../settings.md)[分类选择器](../../form-schema.md#categoryselect) 使用,让用户自行选择所需的分类。
:::

### 描述

根据一组 `metadata.name` 获取文章分类。
Expand All @@ -53,7 +61,7 @@ List\<[#CategoryVo](#categoryvo)\>
### 示例

```html
<div th:with="categories = ${categoryFinder.getByNames(['category-foo', 'category-bar'])}">
<div th:with="categories = ${categoryFinder.getByNames({'category-foo', 'category-bar'})}">
<a th:each="category : ${categories}" th:href="@{${category.status.permalink}}" th:text="${category.spec.displayName}"></a>
</div>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ List\<[#ContributorVo](#contributorvo)\>
### 示例

```html
<div th:with="contributors = ${contributorFinder.getContributors(['contributor-foo, 'contributor-bar'])}">
<div th:with="contributors = ${contributorFinder.getContributors({'contributor-foo, 'contributor-bar'})}">
<span th:each="contributor : ${contributors}" th:text="${contributor.displayName}"></span>
</div>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import TagVo from "../vo/_TagVo.md"
tagFinder.getByName(name)
```

:::info 提示
通常建议配合 [主题设置](../settings.md)[标签选择器](../../form-schema.md#tagselect) 使用,让用户自行选择所需的标签。
:::

### 描述

根据 `metadata.name` 获取标签。
Expand All @@ -37,6 +41,10 @@ tagFinder.getByName(name)
tagFinder.getByNames(names)
```

:::info 提示
通常建议配合 [主题设置](../settings.md)[标签选择器](../../form-schema.md#tagselect) 使用,让用户自行选择所需的标签。
:::

### 描述

根据一组 `metadata.name` 获取标签。
Expand All @@ -52,7 +60,7 @@ List\<[#TagVo](#tagvo)\>
### 示例

```html
<div th:with="tags = ${tagFinder.getByNames(['tag-foo', 'tag-bar'])}">
<div th:with="tags = ${tagFinder.getByNames({'tag-foo', 'tag-bar'})}">
<a th:each="tag : ${tags}" th:href="@{${tag.status.permalink}}" th:text="${tag.spec.displayName}"></a>
</div>
```
Expand Down

0 comments on commit ec9fdde

Please sign in to comment.