Skip to content
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
6 changes: 6 additions & 0 deletions docs/developer-guide/theme/api-changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ title: API 变更日志
description: 记录每一个版本的主题 API 变更记录,方便开发者适配
---

## 2.24.1

### 文章 Finder API > 新增 `random(maxSize)` 方法

在 2.24.1 中,我们为文章 Finder API 新增了 `random(maxSize)` 方法,用于随机获取文章列表。详细文档可查阅:[文章 Finder API#random](../../developer-guide/theme/finder-apis/post.md#randommaxsize)。

## 2.23.0

### 表单定义 > Iconify 表单类型新增 `sizing` 参数
Expand Down
28 changes: 28 additions & 0 deletions docs/developer-guide/theme/finder-apis/post.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,34 @@ List\<[#ListedPostVo](#listedpostvo)\>
</ul>
```

## random(maxSize)

```js
postFinder.random(maxSize);
```

### 描述

随机获取文章列表。

### 参数

1. `maxSize:int` - 获取文章的最大数量,取值范围为 1 到 100。

### 返回值

List\<[#ListedPostVo](#listedpostvo)\>

### 示例

```html
<ul th:with="posts = ${postFinder.random(10)}">
<li th:each="post : ${posts}">
<a th:href="@{${post.status.permalink}}" th:text="${post.spec.title}"></a>
</li>
</ul>
```

## `list({...})`

```js
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ title: API 变更日志
description: 记录每一个版本的主题 API 变更记录,方便开发者适配
---

## 2.24.1

### 文章 Finder API > 新增 `random(maxSize)` 方法

在 2.24.1 中,我们为文章 Finder API 新增了 `random(maxSize)` 方法,用于随机获取文章列表。详细文档可查阅:[文章 Finder API#random](../../developer-guide/theme/finder-apis/post.md#randommaxsize)。

## 2.23.0

### 表单定义 > Iconify 表单类型新增 `sizing` 参数
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,34 @@ List\<[#ListedPostVo](#listedpostvo)\>
</ul>
```

## random(maxSize)

```js
postFinder.random(maxSize);
```

### 描述

随机获取文章列表。

### 参数

1. `maxSize:int` - 获取文章的最大数量,取值范围为 1 到 100。

### 返回值

List\<[#ListedPostVo](#listedpostvo)\>

### 示例

```html
<ul th:with="posts = ${postFinder.random(10)}">
<li th:each="post : ${posts}">
<a th:href="@{${post.status.permalink}}" th:text="${post.spec.title}"></a>
</li>
</ul>
```

## `list({...})`

```js
Expand Down
Loading