Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: correct getByNames method examples for category and tag api #483

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading