mirror of
https://github.com/halo-dev/docs.git
synced 2025-10-21 10:17:34 +00:00
docs: add documentation for author template variables (#176)
添加主题端作者归档页面的文档。后端改动可查阅:https://github.com/halo-dev/docs/issues/144 /kind documentation Fixes #143 ```release-note None ```
This commit is contained in:
@@ -3,7 +3,7 @@ title: 作者
|
||||
description: 作者 - ContributorFinder
|
||||
---
|
||||
|
||||
import Contributor from "../vo/Contributor.md"
|
||||
import ContributorVo from "../vo/ContributorVo.md"
|
||||
|
||||
## getContributor(name)
|
||||
|
||||
@@ -21,7 +21,7 @@ contributorFinder.getContributor(name)
|
||||
|
||||
### 返回值
|
||||
|
||||
[#Contributor](#contributor)
|
||||
[#ContributorVo](#contributorvo)
|
||||
|
||||
### 示例
|
||||
|
||||
@@ -47,7 +47,7 @@ contributorFinder.getContributors(names)
|
||||
|
||||
### 返回值
|
||||
|
||||
List<[#Contributor](#contributor)>
|
||||
List<[#ContributorVo](#contributorvo)>
|
||||
|
||||
### 示例
|
||||
|
||||
@@ -59,6 +59,6 @@ List<[#Contributor](#contributor)>
|
||||
|
||||
## 类型定义
|
||||
|
||||
### Contributor
|
||||
### ContributorVo
|
||||
|
||||
<Contributor />
|
||||
<ContributorVo />
|
||||
|
@@ -7,7 +7,7 @@ import CategoryVo from "../vo/CategoryVo.md";
|
||||
import TagVo from "../vo/TagVo.md";
|
||||
import PostVo from "../vo/PostVo.md";
|
||||
import ContentVo from "../vo/ContentVo.md"
|
||||
import Contributor from "../vo/Contributor.md"
|
||||
import ContributorVo from "../vo/ContributorVo.md"
|
||||
import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
## getByName(postName)
|
||||
@@ -340,9 +340,9 @@ postFinder.archives(page, size, year, month);
|
||||
|
||||
<TagVo />
|
||||
|
||||
### Contributor
|
||||
### ContributorVo
|
||||
|
||||
<Contributor />
|
||||
<ContributorVo />
|
||||
|
||||
### PostVo
|
||||
|
||||
@@ -350,7 +350,7 @@ postFinder.archives(page, size, year, month);
|
||||
|
||||
- [#CategoryVo](#categoryvo)
|
||||
- [#TagVo](#tagvo)
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
- [#ContentVo](#contentvo)
|
||||
|
||||
### ContentVo
|
||||
@@ -375,7 +375,7 @@ postFinder.archives(page, size, year, month);
|
||||
|
||||
- [#CategoryVo](#categoryvo)
|
||||
- [#TagVo](#tagvo)
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
|
||||
### ListResult<ListedPostVo\>
|
||||
|
||||
|
@@ -5,7 +5,7 @@ description: 独立页面 - SinglePageFinder
|
||||
|
||||
import SinglePageVo from "../vo/SinglePageVo.md"
|
||||
import ListedSinglePageVo from "../vo/ListedSinglePageVo.md"
|
||||
import Contributor from "../vo/Contributor.md"
|
||||
import ContributorVo from "../vo/ContributorVo.md"
|
||||
import ContentVo from "../vo/ContentVo.md"
|
||||
|
||||
## getByName(pageName)
|
||||
@@ -95,12 +95,12 @@ singlePageFinder.list(page,size)
|
||||
|
||||
<SinglePageVo />
|
||||
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
- [#ContentVo](#contentvo)
|
||||
|
||||
### ListedSinglePageVo
|
||||
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
|
||||
<ListedSinglePageVo />
|
||||
|
||||
@@ -126,6 +126,6 @@ singlePageFinder.list(page,size)
|
||||
|
||||
<ContentVo />
|
||||
|
||||
### Contributor
|
||||
### ContributorVo
|
||||
|
||||
<Contributor />
|
||||
<ContributorVo />
|
||||
|
@@ -5,7 +5,7 @@ description: archives.html - /archives
|
||||
|
||||
import CategoryVo from "../vo/CategoryVo.md";
|
||||
import TagVo from "../vo/TagVo.md";
|
||||
import Contributor from "../vo/Contributor.md";
|
||||
import ContributorVo from "../vo/ContributorVo.md";
|
||||
import ListedPostVo from "../vo/ListedPostVo.md";
|
||||
|
||||
## 路由信息
|
||||
@@ -59,9 +59,9 @@ import ListedPostVo from "../vo/ListedPostVo.md";
|
||||
|
||||
<TagVo />
|
||||
|
||||
### Contributor
|
||||
### ContributorVo
|
||||
|
||||
<Contributor />
|
||||
<ContributorVo />
|
||||
|
||||
### ListedPostVo
|
||||
|
||||
@@ -69,7 +69,7 @@ import ListedPostVo from "../vo/ListedPostVo.md";
|
||||
|
||||
- [#CategoryVo](#categoryvo)
|
||||
- [#TagVo](#tagvo)
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
|
||||
### PostArchiveVo
|
||||
|
||||
|
104
docs/developer-guide/theme/template-variables/author.md
Normal file
104
docs/developer-guide/theme/template-variables/author.md
Normal file
@@ -0,0 +1,104 @@
|
||||
---
|
||||
title: 作者归档
|
||||
description: author.html - /authors/:name
|
||||
---
|
||||
|
||||
import UserVo from "../vo/UserVo.md"
|
||||
import CategoryVo from "../vo/CategoryVo.md"
|
||||
import TagVo from "../vo/TagVo.md"
|
||||
import ContributorVo from "../vo/ContributorVo.md"
|
||||
import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
## 路由信息
|
||||
|
||||
- 模板路径:`/templates/author.html`
|
||||
- 访问路径:`/authors/:name`
|
||||
|
||||
## 变量
|
||||
|
||||
### author
|
||||
|
||||
#### 变量类型
|
||||
|
||||
[#UserVo](#uservo)
|
||||
|
||||
### posts
|
||||
|
||||
#### 变量类型
|
||||
|
||||
[#UrlContextListResult<ListedPostVo\>](#urlcontextlistresultlistedpostvo)
|
||||
|
||||
#### 示例
|
||||
|
||||
```html title="/templates/author.html"
|
||||
<div>
|
||||
<h1 th:text="${author.spec.displayName}"></h1>
|
||||
<ul>
|
||||
<li th:each="post : ${posts.items}">
|
||||
<a
|
||||
th:text="${post.spec.title}"
|
||||
th:href="${post.status.permalink}"
|
||||
></a>
|
||||
</li>
|
||||
</ul>
|
||||
<div th:if="${posts.hasPrevious() || posts.hasNext()}">
|
||||
<a
|
||||
th:href="@{${posts.prevUrl}}"
|
||||
>
|
||||
<span>上一页</span>
|
||||
</a>
|
||||
<span th:text="${posts.page} +' / '+ ${posts.total}"></span>
|
||||
<a
|
||||
th:href="@{${posts.nextUrl}}"
|
||||
>
|
||||
<span>下一页</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
## 类型定义
|
||||
|
||||
### UserVo
|
||||
|
||||
<UserVo />
|
||||
|
||||
### CategoryVo
|
||||
|
||||
<CategoryVo />
|
||||
|
||||
### TagVo
|
||||
|
||||
<TagVo />
|
||||
|
||||
### ContributorVo
|
||||
|
||||
<ContributorVo />
|
||||
|
||||
### ListedPostVo
|
||||
|
||||
<ListedPostVo />
|
||||
|
||||
- [#CategoryVo](#categoryvo)
|
||||
- [#TagVo](#tagvo)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
|
||||
### UrlContextListResult<ListedPostVo\>
|
||||
|
||||
```json title="UrlContextListResult<ListedPostVo>"
|
||||
{
|
||||
"page": 0, // 当前页码
|
||||
"size": 0, // 每页条数
|
||||
"total": 0, // 总条数
|
||||
"items": "List<#ListedPostVo>", // 文章列表数据
|
||||
"first": true, // 是否为第一页
|
||||
"last": true, // 是否为最后一页
|
||||
"hasNext": true, // 是否有下一页
|
||||
"hasPrevious": true, // 是否有上一页
|
||||
"totalPages": 0, // 总页数
|
||||
"nextUrl": "string", // 下一页链接
|
||||
"prevUrl": "string" // 上一页链接
|
||||
}
|
||||
```
|
||||
|
||||
- [#ListedPostVo](#listedpostvo)
|
@@ -5,7 +5,7 @@ description: category.html - /categories/:slug
|
||||
|
||||
import CategoryVo from "../vo/CategoryVo.md"
|
||||
import TagVo from "../vo/TagVo.md"
|
||||
import Contributor from "../vo/Contributor.md";
|
||||
import ContributorVo from "../vo/ContributorVo.md";
|
||||
import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
## 路由信息
|
||||
@@ -72,9 +72,9 @@ import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
<TagVo />
|
||||
|
||||
### Contributor
|
||||
### ContributorVo
|
||||
|
||||
<Contributor />
|
||||
<ContributorVo />
|
||||
|
||||
### ListedPostVo
|
||||
|
||||
@@ -82,7 +82,7 @@ import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
- [#CategoryVo](#categoryvo)
|
||||
- [#TagVo](#tagvo)
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
|
||||
### UrlContextListResult<ListedPostVo\>
|
||||
|
||||
|
@@ -5,7 +5,7 @@ description: index.html - /
|
||||
|
||||
import CategoryVo from "../vo/CategoryVo.md"
|
||||
import TagVo from "../vo/TagVo.md"
|
||||
import Contributor from "../vo/Contributor.md";
|
||||
import ContributorVo from "../vo/ContributorVo.md";
|
||||
import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
## 路由信息
|
||||
@@ -65,9 +65,9 @@ import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
<TagVo />
|
||||
|
||||
### Contributor
|
||||
### ContributorVo
|
||||
|
||||
<Contributor />
|
||||
<ContributorVo />
|
||||
|
||||
### ListedPostVo
|
||||
|
||||
@@ -75,7 +75,7 @@ import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
- [#CategoryVo](#categoryvo)
|
||||
- [#TagVo](#tagvo)
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
|
||||
### UrlContextListResult<ListedPostVo\>
|
||||
|
||||
|
@@ -4,7 +4,7 @@ description: page.html - /:slug
|
||||
---
|
||||
|
||||
import SinglePageVo from "../vo/SinglePageVo.md"
|
||||
import Contributor from "../vo/Contributor.md"
|
||||
import ContributorVo from "../vo/ContributorVo.md"
|
||||
import ContentVo from "../vo/ContentVo.md"
|
||||
|
||||
## 路由信息
|
||||
@@ -42,12 +42,12 @@ import ContentVo from "../vo/ContentVo.md"
|
||||
<SinglePageVo />
|
||||
|
||||
- [#ContentVo](#contentvo)
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
|
||||
### ContentVo
|
||||
|
||||
<ContentVo />
|
||||
|
||||
### Contributor
|
||||
### ContributorVo
|
||||
|
||||
<Contributor />
|
||||
<ContributorVo />
|
||||
|
@@ -6,7 +6,7 @@ description: post.html - /archives/:slug
|
||||
import CategoryVo from "../vo/CategoryVo.md"
|
||||
import TagVo from "../vo/TagVo.md"
|
||||
import ContentVo from "../vo/ContentVo.md"
|
||||
import Contributor from "../vo/Contributor.md"
|
||||
import ContributorVo from "../vo/ContributorVo.md"
|
||||
import PostVo from "../vo/PostVo.md"
|
||||
|
||||
## 路由信息
|
||||
@@ -47,9 +47,9 @@ import PostVo from "../vo/PostVo.md"
|
||||
|
||||
<TagVo />
|
||||
|
||||
### Contributor
|
||||
### ContributorVo
|
||||
|
||||
<Contributor />
|
||||
<ContributorVo />
|
||||
|
||||
### ContentVo
|
||||
|
||||
@@ -61,5 +61,5 @@ import PostVo from "../vo/PostVo.md"
|
||||
|
||||
- [#CategoryVo](#categoryvo)
|
||||
- [#TagVo](#tagvo)
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
- [#ContentVo](#contentvo)
|
||||
|
@@ -5,7 +5,7 @@ description: tag.html - /tags/:slug
|
||||
|
||||
import CategoryVo from "../vo/CategoryVo.md"
|
||||
import TagVo from "../vo/TagVo.md"
|
||||
import Contributor from "../vo/Contributor.md";
|
||||
import ContributorVo from "../vo/ContributorVo.md";
|
||||
import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
## 路由信息
|
||||
@@ -72,9 +72,9 @@ import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
<TagVo />
|
||||
|
||||
### Contributor
|
||||
### ContributorVo
|
||||
|
||||
<Contributor />
|
||||
<ContributorVo />
|
||||
|
||||
### ListedPostVo
|
||||
|
||||
@@ -82,7 +82,7 @@ import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
- [#CategoryVo](#categoryvo)
|
||||
- [#TagVo](#tagvo)
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
|
||||
### UrlContextListResult<ListedPostVo\>
|
||||
|
||||
|
@@ -1,8 +1,9 @@
|
||||
```json title="Contributor"
|
||||
```json title="ContributorVo"
|
||||
{
|
||||
"name": "string", // 用户名
|
||||
"displayName": "string", // 显示名称
|
||||
"avatar": "string", // 头像
|
||||
"bio": "string" // 描述
|
||||
"bio": "string", // 描述
|
||||
"permalink": "string" // 作者的文章归档页面链接
|
||||
}
|
||||
```
|
@@ -16,7 +16,7 @@
|
||||
"releaseSnapshot": "string",
|
||||
"headSnapshot": "string",
|
||||
"baseSnapshot": "string",
|
||||
"owner": "string", // 创建者名称,即 Contributor 的 metadata.name,非显示名称
|
||||
"owner": "string", // 创建者名称,即 ContributorVo 的 metadata.name,非显示名称
|
||||
"template": "string", // 自定义渲染模板
|
||||
"cover": "string", // 封面图
|
||||
"deleted": false,
|
||||
@@ -54,8 +54,8 @@
|
||||
},
|
||||
"categories": "List<#CategoryVo>", // 分类的集合
|
||||
"tags": "List<#TagVo>", // 标签的集合
|
||||
"contributors": "List<#Contributor>", // 贡献者的集合
|
||||
"owner": "#Contributor", // 创建者
|
||||
"contributors": "List<#ContributorVo>", // 贡献者的集合
|
||||
"owner": "#ContributorVo", // 创建者
|
||||
"stats": {
|
||||
"visit": 0, // 访问数量
|
||||
"upvote": 0, // 点赞数量
|
||||
|
@@ -16,7 +16,7 @@
|
||||
"releaseSnapshot": "string",
|
||||
"headSnapshot": "string",
|
||||
"baseSnapshot": "string",
|
||||
"owner": "string", // 创建者名称,即 Contributor 的 metadata.name,非显示名称
|
||||
"owner": "string", // 创建者名称,即 ContributorVo 的 metadata.name,非显示名称
|
||||
"template": "string", // 自定义渲染模板
|
||||
"cover": "string", // 封面图
|
||||
"deleted": false,
|
||||
@@ -51,7 +51,7 @@
|
||||
"upvote": 0, // 点赞数量
|
||||
"comment": 0 // 评论数量
|
||||
},
|
||||
"contributors": "List<#Contributor>", // 贡献者的集合
|
||||
"owner": "#Contributor" // 创建者
|
||||
"contributors": "List<#ContributorVo>", // 贡献者的集合
|
||||
"owner": "#ContributorVo" // 创建者
|
||||
}
|
||||
```
|
||||
|
@@ -16,7 +16,7 @@
|
||||
"releaseSnapshot": "string",
|
||||
"headSnapshot": "string",
|
||||
"baseSnapshot": "string",
|
||||
"owner": "string", // 创建者名称,即 Contributor 的 metadata.name,非显示名称
|
||||
"owner": "string", // 创建者名称,即 ContributorVo 的 metadata.name,非显示名称
|
||||
"template": "string", // 自定义渲染模板
|
||||
"cover": "string", // 封面图
|
||||
"deleted": false,
|
||||
@@ -54,8 +54,8 @@
|
||||
},
|
||||
"categories": "List<#CategoryVo>", // 分类的集合
|
||||
"tags": "List<#TagVo>", // 标签的集合
|
||||
"contributors": "List<#Contributor>", // 贡献者的集合
|
||||
"owner": "#Contributor", // 创建者
|
||||
"contributors": "List<#ContributorVo>", // 贡献者的集合
|
||||
"owner": "#ContributorVo", // 创建者
|
||||
"stats": {
|
||||
"visit": 0, // 访问数量
|
||||
"upvote": 0, // 点赞数量
|
||||
|
@@ -16,7 +16,7 @@
|
||||
"releaseSnapshot": "string",
|
||||
"headSnapshot": "string",
|
||||
"baseSnapshot": "string",
|
||||
"owner": "string", // 创建者名称,即 Contributor 的 metadata.name,非显示名称
|
||||
"owner": "string", // 创建者名称,即 ContributorVo 的 metadata.name,非显示名称
|
||||
"template": "string", // 自定义渲染模板
|
||||
"cover": "string", // 封面图
|
||||
"deleted": false,
|
||||
@@ -51,8 +51,8 @@
|
||||
"upvote": 0, // 点赞数量
|
||||
"comment": 0 // 评论数量
|
||||
},
|
||||
"contributors": "List<#Contributor>", // 贡献者的集合
|
||||
"owner": "#Contributor", // 创建者
|
||||
"contributors": "List<#ContributorVo>", // 贡献者的集合
|
||||
"owner": "#ContributorVo", // 创建者
|
||||
"content": "#ContentVo" // 内容
|
||||
}
|
||||
```
|
||||
|
28
docs/developer-guide/theme/vo/UserVo.md
Normal file
28
docs/developer-guide/theme/vo/UserVo.md
Normal file
@@ -0,0 +1,28 @@
|
||||
```json title="UserVo"
|
||||
{
|
||||
"metadata": {
|
||||
"name": "string", // 唯一标识
|
||||
"labels": {
|
||||
"additionalProp1": "string"
|
||||
},
|
||||
"annotations": {
|
||||
"additionalProp1": "string"
|
||||
},
|
||||
"creationTimestamp": "2022-11-20T13:06:38.512Z" // 创建时间
|
||||
},
|
||||
"spec": {
|
||||
"displayName": "string", // 显示名称
|
||||
"avatar": "string", // 头像链接
|
||||
"email": "string", // 邮箱地址
|
||||
"phone": "string", // 电话号码
|
||||
"bio": 0, // 描述
|
||||
"registeredAt": "2022-11-20T13:06:38.512Z", // 注册时间
|
||||
"twoFactorAuthEnabled": false, // 是否启用二次验证
|
||||
"disabled": false // 是否禁用
|
||||
},
|
||||
"status": {
|
||||
"lastLoginAt": "2022-11-20T13:06:38.512Z", // 最后登录时间
|
||||
"permalink": "string" // 作者的文章归档页面链接
|
||||
}
|
||||
}
|
||||
```
|
@@ -128,6 +128,7 @@ module.exports = {
|
||||
"developer-guide/theme/template-variables/tag",
|
||||
"developer-guide/theme/template-variables/categories",
|
||||
"developer-guide/theme/template-variables/category",
|
||||
"developer-guide/theme/template-variables/author",
|
||||
],
|
||||
},
|
||||
{
|
||||
|
@@ -3,7 +3,7 @@ title: 作者
|
||||
description: 作者 - ContributorFinder
|
||||
---
|
||||
|
||||
import Contributor from "../vo/Contributor.md"
|
||||
import ContributorVo from "../vo/ContributorVo.md"
|
||||
|
||||
## getContributor(name)
|
||||
|
||||
@@ -21,7 +21,7 @@ contributorFinder.getContributor(name)
|
||||
|
||||
### 返回值
|
||||
|
||||
[#Contributor](#contributor)
|
||||
[#ContributorVo](#contributorvo)
|
||||
|
||||
### 示例
|
||||
|
||||
@@ -47,7 +47,7 @@ contributorFinder.getContributors(names)
|
||||
|
||||
### 返回值
|
||||
|
||||
List<[#Contributor](#contributor)>
|
||||
List<[#ContributorVo](#contributorvo)>
|
||||
|
||||
### 示例
|
||||
|
||||
@@ -59,6 +59,6 @@ List<[#Contributor](#contributor)>
|
||||
|
||||
## 类型定义
|
||||
|
||||
### Contributor
|
||||
### ContributorVo
|
||||
|
||||
<Contributor />
|
||||
<ContributorVo />
|
||||
|
@@ -7,7 +7,7 @@ import CategoryVo from "../vo/CategoryVo.md";
|
||||
import TagVo from "../vo/TagVo.md";
|
||||
import PostVo from "../vo/PostVo.md";
|
||||
import ContentVo from "../vo/ContentVo.md"
|
||||
import Contributor from "../vo/Contributor.md"
|
||||
import ContributorVo from "../vo/ContributorVo.md"
|
||||
import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
## getByName(postName)
|
||||
@@ -340,9 +340,9 @@ postFinder.archives(page, size, year, month);
|
||||
|
||||
<TagVo />
|
||||
|
||||
### Contributor
|
||||
### ContributorVo
|
||||
|
||||
<Contributor />
|
||||
<ContributorVo />
|
||||
|
||||
### PostVo
|
||||
|
||||
@@ -350,7 +350,7 @@ postFinder.archives(page, size, year, month);
|
||||
|
||||
- [#CategoryVo](#categoryvo)
|
||||
- [#TagVo](#tagvo)
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
- [#ContentVo](#contentvo)
|
||||
|
||||
### ContentVo
|
||||
@@ -375,7 +375,7 @@ postFinder.archives(page, size, year, month);
|
||||
|
||||
- [#CategoryVo](#categoryvo)
|
||||
- [#TagVo](#tagvo)
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
|
||||
### ListResult<ListedPostVo\>
|
||||
|
||||
|
@@ -5,7 +5,7 @@ description: 独立页面 - SinglePageFinder
|
||||
|
||||
import SinglePageVo from "../vo/SinglePageVo.md"
|
||||
import ListedSinglePageVo from "../vo/ListedSinglePageVo.md"
|
||||
import Contributor from "../vo/Contributor.md"
|
||||
import ContributorVo from "../vo/ContributorVo.md"
|
||||
import ContentVo from "../vo/ContentVo.md"
|
||||
|
||||
## getByName(pageName)
|
||||
@@ -95,12 +95,12 @@ singlePageFinder.list(page,size)
|
||||
|
||||
<SinglePageVo />
|
||||
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
- [#ContentVo](#contentvo)
|
||||
|
||||
### ListedSinglePageVo
|
||||
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
|
||||
<ListedSinglePageVo />
|
||||
|
||||
@@ -126,6 +126,6 @@ singlePageFinder.list(page,size)
|
||||
|
||||
<ContentVo />
|
||||
|
||||
### Contributor
|
||||
### ContributorVo
|
||||
|
||||
<Contributor />
|
||||
<ContributorVo />
|
||||
|
@@ -5,7 +5,7 @@ description: archives.html - /archives
|
||||
|
||||
import CategoryVo from "../vo/CategoryVo.md";
|
||||
import TagVo from "../vo/TagVo.md";
|
||||
import Contributor from "../vo/Contributor.md";
|
||||
import ContributorVo from "../vo/ContributorVo.md";
|
||||
import ListedPostVo from "../vo/ListedPostVo.md";
|
||||
|
||||
## 路由信息
|
||||
@@ -59,9 +59,9 @@ import ListedPostVo from "../vo/ListedPostVo.md";
|
||||
|
||||
<TagVo />
|
||||
|
||||
### Contributor
|
||||
### ContributorVo
|
||||
|
||||
<Contributor />
|
||||
<ContributorVo />
|
||||
|
||||
### ListedPostVo
|
||||
|
||||
@@ -69,7 +69,7 @@ import ListedPostVo from "../vo/ListedPostVo.md";
|
||||
|
||||
- [#CategoryVo](#categoryvo)
|
||||
- [#TagVo](#tagvo)
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
|
||||
### PostArchiveVo
|
||||
|
||||
|
@@ -0,0 +1,104 @@
|
||||
---
|
||||
title: 作者归档
|
||||
description: author.html - /authors/:name
|
||||
---
|
||||
|
||||
import UserVo from "../vo/UserVo.md"
|
||||
import CategoryVo from "../vo/CategoryVo.md"
|
||||
import TagVo from "../vo/TagVo.md"
|
||||
import ContributorVo from "../vo/ContributorVo.md"
|
||||
import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
## 路由信息
|
||||
|
||||
- 模板路径:`/templates/author.html`
|
||||
- 访问路径:`/authors/:name`
|
||||
|
||||
## 变量
|
||||
|
||||
### author
|
||||
|
||||
#### 变量类型
|
||||
|
||||
[#UserVo](#uservo)
|
||||
|
||||
### posts
|
||||
|
||||
#### 变量类型
|
||||
|
||||
[#UrlContextListResult<ListedPostVo\>](#urlcontextlistresultlistedpostvo)
|
||||
|
||||
#### 示例
|
||||
|
||||
```html title="/templates/author.html"
|
||||
<div>
|
||||
<h1 th:text="${author.spec.displayName}"></h1>
|
||||
<ul>
|
||||
<li th:each="post : ${posts.items}">
|
||||
<a
|
||||
th:text="${post.spec.title}"
|
||||
th:href="${post.status.permalink}"
|
||||
></a>
|
||||
</li>
|
||||
</ul>
|
||||
<div th:if="${posts.hasPrevious() || posts.hasNext()}">
|
||||
<a
|
||||
th:href="@{${posts.prevUrl}}"
|
||||
>
|
||||
<span>上一页</span>
|
||||
</a>
|
||||
<span th:text="${posts.page} +' / '+ ${posts.total}"></span>
|
||||
<a
|
||||
th:href="@{${posts.nextUrl}}"
|
||||
>
|
||||
<span>下一页</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
## 类型定义
|
||||
|
||||
### UserVo
|
||||
|
||||
<UserVo />
|
||||
|
||||
### CategoryVo
|
||||
|
||||
<CategoryVo />
|
||||
|
||||
### TagVo
|
||||
|
||||
<TagVo />
|
||||
|
||||
### ContributorVo
|
||||
|
||||
<ContributorVo />
|
||||
|
||||
### ListedPostVo
|
||||
|
||||
<ListedPostVo />
|
||||
|
||||
- [#CategoryVo](#categoryvo)
|
||||
- [#TagVo](#tagvo)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
|
||||
### UrlContextListResult<ListedPostVo\>
|
||||
|
||||
```json title="UrlContextListResult<ListedPostVo>"
|
||||
{
|
||||
"page": 0, // 当前页码
|
||||
"size": 0, // 每页条数
|
||||
"total": 0, // 总条数
|
||||
"items": "List<#ListedPostVo>", // 文章列表数据
|
||||
"first": true, // 是否为第一页
|
||||
"last": true, // 是否为最后一页
|
||||
"hasNext": true, // 是否有下一页
|
||||
"hasPrevious": true, // 是否有上一页
|
||||
"totalPages": 0, // 总页数
|
||||
"nextUrl": "string", // 下一页链接
|
||||
"prevUrl": "string" // 上一页链接
|
||||
}
|
||||
```
|
||||
|
||||
- [#ListedPostVo](#listedpostvo)
|
@@ -5,7 +5,7 @@ description: category.html - /categories/:slug
|
||||
|
||||
import CategoryVo from "../vo/CategoryVo.md"
|
||||
import TagVo from "../vo/TagVo.md"
|
||||
import Contributor from "../vo/Contributor.md";
|
||||
import ContributorVo from "../vo/ContributorVo.md";
|
||||
import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
## 路由信息
|
||||
@@ -72,9 +72,9 @@ import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
<TagVo />
|
||||
|
||||
### Contributor
|
||||
### ContributorVo
|
||||
|
||||
<Contributor />
|
||||
<ContributorVo />
|
||||
|
||||
### ListedPostVo
|
||||
|
||||
@@ -82,7 +82,7 @@ import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
- [#CategoryVo](#categoryvo)
|
||||
- [#TagVo](#tagvo)
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
|
||||
### UrlContextListResult<ListedPostVo\>
|
||||
|
||||
|
@@ -5,7 +5,7 @@ description: index.html - /
|
||||
|
||||
import CategoryVo from "../vo/CategoryVo.md"
|
||||
import TagVo from "../vo/TagVo.md"
|
||||
import Contributor from "../vo/Contributor.md";
|
||||
import ContributorVo from "../vo/ContributorVo.md";
|
||||
import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
## 路由信息
|
||||
@@ -65,9 +65,9 @@ import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
<TagVo />
|
||||
|
||||
### Contributor
|
||||
### ContributorVo
|
||||
|
||||
<Contributor />
|
||||
<ContributorVo />
|
||||
|
||||
### ListedPostVo
|
||||
|
||||
@@ -75,7 +75,7 @@ import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
- [#CategoryVo](#categoryvo)
|
||||
- [#TagVo](#tagvo)
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
|
||||
### UrlContextListResult<ListedPostVo\>
|
||||
|
||||
|
@@ -4,7 +4,7 @@ description: page.html - /:slug
|
||||
---
|
||||
|
||||
import SinglePageVo from "../vo/SinglePageVo.md"
|
||||
import Contributor from "../vo/Contributor.md"
|
||||
import ContributorVo from "../vo/ContributorVo.md"
|
||||
import ContentVo from "../vo/ContentVo.md"
|
||||
|
||||
## 路由信息
|
||||
@@ -42,12 +42,12 @@ import ContentVo from "../vo/ContentVo.md"
|
||||
<SinglePageVo />
|
||||
|
||||
- [#ContentVo](#contentvo)
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
|
||||
### ContentVo
|
||||
|
||||
<ContentVo />
|
||||
|
||||
### Contributor
|
||||
### ContributorVo
|
||||
|
||||
<Contributor />
|
||||
<ContributorVo />
|
||||
|
@@ -6,7 +6,7 @@ description: post.html - /archives/:slug
|
||||
import CategoryVo from "../vo/CategoryVo.md"
|
||||
import TagVo from "../vo/TagVo.md"
|
||||
import ContentVo from "../vo/ContentVo.md"
|
||||
import Contributor from "../vo/Contributor.md"
|
||||
import ContributorVo from "../vo/ContributorVo.md"
|
||||
import PostVo from "../vo/PostVo.md"
|
||||
|
||||
## 路由信息
|
||||
@@ -47,9 +47,9 @@ import PostVo from "../vo/PostVo.md"
|
||||
|
||||
<TagVo />
|
||||
|
||||
### Contributor
|
||||
### ContributorVo
|
||||
|
||||
<Contributor />
|
||||
<ContributorVo />
|
||||
|
||||
### ContentVo
|
||||
|
||||
@@ -61,5 +61,5 @@ import PostVo from "../vo/PostVo.md"
|
||||
|
||||
- [#CategoryVo](#categoryvo)
|
||||
- [#TagVo](#tagvo)
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
- [#ContentVo](#contentvo)
|
||||
|
@@ -5,7 +5,7 @@ description: tag.html - /tags/:slug
|
||||
|
||||
import CategoryVo from "../vo/CategoryVo.md"
|
||||
import TagVo from "../vo/TagVo.md"
|
||||
import Contributor from "../vo/Contributor.md";
|
||||
import ContributorVo from "../vo/ContributorVo.md";
|
||||
import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
## 路由信息
|
||||
@@ -72,9 +72,9 @@ import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
<TagVo />
|
||||
|
||||
### Contributor
|
||||
### ContributorVo
|
||||
|
||||
<Contributor />
|
||||
<ContributorVo />
|
||||
|
||||
### ListedPostVo
|
||||
|
||||
@@ -82,7 +82,7 @@ import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
- [#CategoryVo](#categoryvo)
|
||||
- [#TagVo](#tagvo)
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
|
||||
### UrlContextListResult<ListedPostVo\>
|
||||
|
||||
|
@@ -1,8 +1,9 @@
|
||||
```json title="Contributor"
|
||||
```json title="ContributorVo"
|
||||
{
|
||||
"name": "string", // 用户名
|
||||
"displayName": "string", // 显示名称
|
||||
"avatar": "string", // 头像
|
||||
"bio": "string" // 描述
|
||||
"bio": "string", // 描述
|
||||
"permalink": "string" // 作者的文章归档页面链接
|
||||
}
|
||||
```
|
@@ -16,7 +16,7 @@
|
||||
"releaseSnapshot": "string",
|
||||
"headSnapshot": "string",
|
||||
"baseSnapshot": "string",
|
||||
"owner": "string", // 创建者名称,即 Contributor 的 metadata.name,非显示名称
|
||||
"owner": "string", // 创建者名称,即 ContributorVo 的 metadata.name,非显示名称
|
||||
"template": "string", // 自定义渲染模板
|
||||
"cover": "string", // 封面图
|
||||
"deleted": false,
|
||||
@@ -47,14 +47,14 @@
|
||||
"excerpt": "string", // 最终生成的摘要
|
||||
"inProgress": true,
|
||||
"commentsCount": 0, // 评论数
|
||||
"contributors": [ // 贡献者名称,Contributor 的 metadata.name 的集合
|
||||
"contributors": [ // 贡献者名称,ContributorVo 的 metadata.name 的集合
|
||||
"string"
|
||||
]
|
||||
},
|
||||
"categories": "List<#CategoryVo>", // 分类的集合
|
||||
"tags": "List<#TagVo>", // 标签的集合
|
||||
"contributors": "List<#Contributor>", // 贡献者的集合
|
||||
"owner": "#Contributor", // 创建者
|
||||
"contributors": "List<#ContributorVo>", // 贡献者的集合
|
||||
"owner": "#ContributorVo", // 创建者
|
||||
"stats": {
|
||||
"visit": 0, // 访问数量
|
||||
"upvote": 0, // 点赞数量
|
||||
|
@@ -16,7 +16,7 @@
|
||||
"releaseSnapshot": "string",
|
||||
"headSnapshot": "string",
|
||||
"baseSnapshot": "string",
|
||||
"owner": "string", // 创建者名称,即 Contributor 的 metadata.name,非显示名称
|
||||
"owner": "string", // 创建者名称,即 ContributorVo 的 metadata.name,非显示名称
|
||||
"template": "string", // 自定义渲染模板
|
||||
"cover": "string", // 封面图
|
||||
"deleted": false,
|
||||
@@ -41,7 +41,7 @@
|
||||
"excerpt": "string", // 最终生成的摘要
|
||||
"inProgress": true,
|
||||
"commentsCount": 0, // 评论数
|
||||
"contributors": [ // 贡献者名称,Contributor 的 metadata.name 的集合
|
||||
"contributors": [ // 贡献者名称,ContributorVo 的 metadata.name 的集合
|
||||
"string"
|
||||
]
|
||||
},
|
||||
@@ -50,7 +50,7 @@
|
||||
"upvote": 0, // 点赞数量
|
||||
"comment": 0 // 评论数量
|
||||
},
|
||||
"contributors": "List<#Contributor>", // 贡献者的集合
|
||||
"owner": "#Contributor" // 创建者
|
||||
"contributors": "List<#ContributorVo>", // 贡献者的集合
|
||||
"owner": "#ContributorVo" // 创建者
|
||||
}
|
||||
```
|
||||
|
@@ -16,7 +16,7 @@
|
||||
"releaseSnapshot": "string",
|
||||
"headSnapshot": "string",
|
||||
"baseSnapshot": "string",
|
||||
"owner": "string", // 创建者名称,即 Contributor 的 metadata.name,非显示名称
|
||||
"owner": "string", // 创建者名称,即 ContributorVo 的 metadata.name,非显示名称
|
||||
"template": "string", // 自定义渲染模板
|
||||
"cover": "string", // 封面图
|
||||
"deleted": false,
|
||||
@@ -47,14 +47,14 @@
|
||||
"excerpt": "string", // 最终生成的摘要
|
||||
"inProgress": true,
|
||||
"commentsCount": 0, // 评论数
|
||||
"contributors": [ // 贡献者名称,Contributor 的 metadata.name 的集合
|
||||
"contributors": [ // 贡献者名称,ContributorVo 的 metadata.name 的集合
|
||||
"string"
|
||||
]
|
||||
},
|
||||
"categories": "List<#CategoryVo>", // 分类的集合
|
||||
"tags": "List<#TagVo>", // 标签的集合
|
||||
"contributors": "List<#Contributor>", // 贡献者的集合
|
||||
"owner": "#Contributor", // 创建者
|
||||
"contributors": "List<#ContributorVo>", // 贡献者的集合
|
||||
"owner": "#ContributorVo", // 创建者
|
||||
"stats": {
|
||||
"visit": 0, // 访问数量
|
||||
"upvote": 0, // 点赞数量
|
||||
|
@@ -16,7 +16,7 @@
|
||||
"releaseSnapshot": "string",
|
||||
"headSnapshot": "string",
|
||||
"baseSnapshot": "string",
|
||||
"owner": "string", // 创建者名称,即 Contributor 的 metadata.name,非显示名称
|
||||
"owner": "string", // 创建者名称,即 ContributorVo 的 metadata.name,非显示名称
|
||||
"template": "string", // 自定义渲染模板
|
||||
"cover": "string", // 封面图
|
||||
"deleted": false,
|
||||
@@ -41,7 +41,7 @@
|
||||
"excerpt": "string", // 最终生成的摘要
|
||||
"inProgress": true,
|
||||
"commentsCount": 0, // 评论数
|
||||
"contributors": [ // 贡献者名称,Contributor 的 metadata.name 的集合
|
||||
"contributors": [ // 贡献者名称,ContributorVo 的 metadata.name 的集合
|
||||
"string"
|
||||
]
|
||||
},
|
||||
@@ -50,8 +50,8 @@
|
||||
"upvote": 0, // 点赞数量
|
||||
"comment": 0 // 评论数量
|
||||
},
|
||||
"contributors": "List<#Contributor>", // 贡献者的集合
|
||||
"owner": "#Contributor", // 创建者
|
||||
"contributors": "List<#ContributorVo>", // 贡献者的集合
|
||||
"owner": "#ContributorVo", // 创建者
|
||||
"content": "#ContentVo" // 内容
|
||||
}
|
||||
```
|
||||
|
@@ -0,0 +1,28 @@
|
||||
```json title="UserVo"
|
||||
{
|
||||
"metadata": {
|
||||
"name": "string", // 唯一标识
|
||||
"labels": {
|
||||
"additionalProp1": "string"
|
||||
},
|
||||
"annotations": {
|
||||
"additionalProp1": "string"
|
||||
},
|
||||
"creationTimestamp": "2022-11-20T13:06:38.512Z" // 创建时间
|
||||
},
|
||||
"spec": {
|
||||
"displayName": "string", // 显示名称
|
||||
"avatar": "string", // 头像链接
|
||||
"email": "string", // 邮箱地址
|
||||
"phone": "string", // 电话号码
|
||||
"bio": 0, // 描述
|
||||
"registeredAt": "2022-11-20T13:06:38.512Z", // 注册时间
|
||||
"twoFactorAuthEnabled": false, // 是否启用二次验证
|
||||
"disabled": false // 是否禁用
|
||||
},
|
||||
"status": {
|
||||
"lastLoginAt": "2022-11-20T13:06:38.512Z", // 最后登录时间
|
||||
"permalink": "string" // 作者的文章归档页面链接
|
||||
}
|
||||
}
|
||||
```
|
@@ -3,7 +3,7 @@ title: 作者
|
||||
description: 作者 - ContributorFinder
|
||||
---
|
||||
|
||||
import Contributor from "../vo/Contributor.md"
|
||||
import ContributorVo from "../vo/ContributorVo.md"
|
||||
|
||||
## getContributor(name)
|
||||
|
||||
@@ -21,7 +21,7 @@ contributorFinder.getContributor(name)
|
||||
|
||||
### 返回值
|
||||
|
||||
[#Contributor](#contributor)
|
||||
[#ContributorVo](#contributorvo)
|
||||
|
||||
### 示例
|
||||
|
||||
@@ -47,7 +47,7 @@ contributorFinder.getContributors(names)
|
||||
|
||||
### 返回值
|
||||
|
||||
List<[#Contributor](#contributor)>
|
||||
List<[#ContributorVo](#contributorvo)>
|
||||
|
||||
### 示例
|
||||
|
||||
@@ -59,6 +59,6 @@ List<[#Contributor](#contributor)>
|
||||
|
||||
## 类型定义
|
||||
|
||||
### Contributor
|
||||
### ContributorVo
|
||||
|
||||
<Contributor />
|
||||
<ContributorVo />
|
||||
|
@@ -7,7 +7,7 @@ import CategoryVo from "../vo/CategoryVo.md";
|
||||
import TagVo from "../vo/TagVo.md";
|
||||
import PostVo from "../vo/PostVo.md";
|
||||
import ContentVo from "../vo/ContentVo.md"
|
||||
import Contributor from "../vo/Contributor.md"
|
||||
import ContributorVo from "../vo/ContributorVo.md"
|
||||
import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
## getByName(postName)
|
||||
@@ -340,9 +340,9 @@ postFinder.archives(page, size, year, month);
|
||||
|
||||
<TagVo />
|
||||
|
||||
### Contributor
|
||||
### ContributorVo
|
||||
|
||||
<Contributor />
|
||||
<ContributorVo />
|
||||
|
||||
### PostVo
|
||||
|
||||
@@ -350,7 +350,7 @@ postFinder.archives(page, size, year, month);
|
||||
|
||||
- [#CategoryVo](#categoryvo)
|
||||
- [#TagVo](#tagvo)
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
- [#ContentVo](#contentvo)
|
||||
|
||||
### ContentVo
|
||||
@@ -375,7 +375,7 @@ postFinder.archives(page, size, year, month);
|
||||
|
||||
- [#CategoryVo](#categoryvo)
|
||||
- [#TagVo](#tagvo)
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
|
||||
### ListResult<ListedPostVo\>
|
||||
|
||||
|
@@ -5,7 +5,7 @@ description: 独立页面 - SinglePageFinder
|
||||
|
||||
import SinglePageVo from "../vo/SinglePageVo.md"
|
||||
import ListedSinglePageVo from "../vo/ListedSinglePageVo.md"
|
||||
import Contributor from "../vo/Contributor.md"
|
||||
import ContributorVo from "../vo/ContributorVo.md"
|
||||
import ContentVo from "../vo/ContentVo.md"
|
||||
|
||||
## getByName(pageName)
|
||||
@@ -95,12 +95,12 @@ singlePageFinder.list(page,size)
|
||||
|
||||
<SinglePageVo />
|
||||
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
- [#ContentVo](#contentvo)
|
||||
|
||||
### ListedSinglePageVo
|
||||
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
|
||||
<ListedSinglePageVo />
|
||||
|
||||
@@ -126,6 +126,6 @@ singlePageFinder.list(page,size)
|
||||
|
||||
<ContentVo />
|
||||
|
||||
### Contributor
|
||||
### ContributorVo
|
||||
|
||||
<Contributor />
|
||||
<ContributorVo />
|
||||
|
@@ -5,7 +5,7 @@ description: archives.html - /archives
|
||||
|
||||
import CategoryVo from "../vo/CategoryVo.md";
|
||||
import TagVo from "../vo/TagVo.md";
|
||||
import Contributor from "../vo/Contributor.md";
|
||||
import ContributorVo from "../vo/ContributorVo.md";
|
||||
import ListedPostVo from "../vo/ListedPostVo.md";
|
||||
|
||||
## 路由信息
|
||||
@@ -59,9 +59,9 @@ import ListedPostVo from "../vo/ListedPostVo.md";
|
||||
|
||||
<TagVo />
|
||||
|
||||
### Contributor
|
||||
### ContributorVo
|
||||
|
||||
<Contributor />
|
||||
<ContributorVo />
|
||||
|
||||
### ListedPostVo
|
||||
|
||||
@@ -69,7 +69,7 @@ import ListedPostVo from "../vo/ListedPostVo.md";
|
||||
|
||||
- [#CategoryVo](#categoryvo)
|
||||
- [#TagVo](#tagvo)
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
|
||||
### PostArchiveVo
|
||||
|
||||
|
@@ -0,0 +1,104 @@
|
||||
---
|
||||
title: 作者归档
|
||||
description: author.html - /authors/:name
|
||||
---
|
||||
|
||||
import UserVo from "../vo/UserVo.md"
|
||||
import CategoryVo from "../vo/CategoryVo.md"
|
||||
import TagVo from "../vo/TagVo.md"
|
||||
import ContributorVo from "../vo/ContributorVo.md"
|
||||
import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
## 路由信息
|
||||
|
||||
- 模板路径:`/templates/author.html`
|
||||
- 访问路径:`/authors/:name`
|
||||
|
||||
## 变量
|
||||
|
||||
### author
|
||||
|
||||
#### 变量类型
|
||||
|
||||
[#UserVo](#uservo)
|
||||
|
||||
### posts
|
||||
|
||||
#### 变量类型
|
||||
|
||||
[#UrlContextListResult<ListedPostVo\>](#urlcontextlistresultlistedpostvo)
|
||||
|
||||
#### 示例
|
||||
|
||||
```html title="/templates/author.html"
|
||||
<div>
|
||||
<h1 th:text="${author.spec.displayName}"></h1>
|
||||
<ul>
|
||||
<li th:each="post : ${posts.items}">
|
||||
<a
|
||||
th:text="${post.spec.title}"
|
||||
th:href="${post.status.permalink}"
|
||||
></a>
|
||||
</li>
|
||||
</ul>
|
||||
<div th:if="${posts.hasPrevious() || posts.hasNext()}">
|
||||
<a
|
||||
th:href="@{${posts.prevUrl}}"
|
||||
>
|
||||
<span>上一页</span>
|
||||
</a>
|
||||
<span th:text="${posts.page} +' / '+ ${posts.total}"></span>
|
||||
<a
|
||||
th:href="@{${posts.nextUrl}}"
|
||||
>
|
||||
<span>下一页</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
## 类型定义
|
||||
|
||||
### UserVo
|
||||
|
||||
<UserVo />
|
||||
|
||||
### CategoryVo
|
||||
|
||||
<CategoryVo />
|
||||
|
||||
### TagVo
|
||||
|
||||
<TagVo />
|
||||
|
||||
### ContributorVo
|
||||
|
||||
<ContributorVo />
|
||||
|
||||
### ListedPostVo
|
||||
|
||||
<ListedPostVo />
|
||||
|
||||
- [#CategoryVo](#categoryvo)
|
||||
- [#TagVo](#tagvo)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
|
||||
### UrlContextListResult<ListedPostVo\>
|
||||
|
||||
```json title="UrlContextListResult<ListedPostVo>"
|
||||
{
|
||||
"page": 0, // 当前页码
|
||||
"size": 0, // 每页条数
|
||||
"total": 0, // 总条数
|
||||
"items": "List<#ListedPostVo>", // 文章列表数据
|
||||
"first": true, // 是否为第一页
|
||||
"last": true, // 是否为最后一页
|
||||
"hasNext": true, // 是否有下一页
|
||||
"hasPrevious": true, // 是否有上一页
|
||||
"totalPages": 0, // 总页数
|
||||
"nextUrl": "string", // 下一页链接
|
||||
"prevUrl": "string" // 上一页链接
|
||||
}
|
||||
```
|
||||
|
||||
- [#ListedPostVo](#listedpostvo)
|
@@ -5,7 +5,7 @@ description: category.html - /categories/:slug
|
||||
|
||||
import CategoryVo from "../vo/CategoryVo.md"
|
||||
import TagVo from "../vo/TagVo.md"
|
||||
import Contributor from "../vo/Contributor.md";
|
||||
import ContributorVo from "../vo/ContributorVo.md";
|
||||
import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
## 路由信息
|
||||
@@ -72,9 +72,9 @@ import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
<TagVo />
|
||||
|
||||
### Contributor
|
||||
### ContributorVo
|
||||
|
||||
<Contributor />
|
||||
<ContributorVo />
|
||||
|
||||
### ListedPostVo
|
||||
|
||||
@@ -82,7 +82,7 @@ import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
- [#CategoryVo](#categoryvo)
|
||||
- [#TagVo](#tagvo)
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
|
||||
### UrlContextListResult<ListedPostVo\>
|
||||
|
||||
|
@@ -5,7 +5,7 @@ description: index.html - /
|
||||
|
||||
import CategoryVo from "../vo/CategoryVo.md"
|
||||
import TagVo from "../vo/TagVo.md"
|
||||
import Contributor from "../vo/Contributor.md";
|
||||
import ContributorVo from "../vo/ContributorVo.md";
|
||||
import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
## 路由信息
|
||||
@@ -65,9 +65,9 @@ import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
<TagVo />
|
||||
|
||||
### Contributor
|
||||
### ContributorVo
|
||||
|
||||
<Contributor />
|
||||
<ContributorVo />
|
||||
|
||||
### ListedPostVo
|
||||
|
||||
@@ -75,7 +75,7 @@ import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
- [#CategoryVo](#categoryvo)
|
||||
- [#TagVo](#tagvo)
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
|
||||
### UrlContextListResult<ListedPostVo\>
|
||||
|
||||
|
@@ -4,7 +4,7 @@ description: page.html - /:slug
|
||||
---
|
||||
|
||||
import SinglePageVo from "../vo/SinglePageVo.md"
|
||||
import Contributor from "../vo/Contributor.md"
|
||||
import ContributorVo from "../vo/ContributorVo.md"
|
||||
import ContentVo from "../vo/ContentVo.md"
|
||||
|
||||
## 路由信息
|
||||
@@ -42,12 +42,12 @@ import ContentVo from "../vo/ContentVo.md"
|
||||
<SinglePageVo />
|
||||
|
||||
- [#ContentVo](#contentvo)
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
|
||||
### ContentVo
|
||||
|
||||
<ContentVo />
|
||||
|
||||
### Contributor
|
||||
### ContributorVo
|
||||
|
||||
<Contributor />
|
||||
<ContributorVo />
|
||||
|
@@ -6,7 +6,7 @@ description: post.html - /archives/:slug
|
||||
import CategoryVo from "../vo/CategoryVo.md"
|
||||
import TagVo from "../vo/TagVo.md"
|
||||
import ContentVo from "../vo/ContentVo.md"
|
||||
import Contributor from "../vo/Contributor.md"
|
||||
import ContributorVo from "../vo/ContributorVo.md"
|
||||
import PostVo from "../vo/PostVo.md"
|
||||
|
||||
## 路由信息
|
||||
@@ -47,9 +47,9 @@ import PostVo from "../vo/PostVo.md"
|
||||
|
||||
<TagVo />
|
||||
|
||||
### Contributor
|
||||
### ContributorVo
|
||||
|
||||
<Contributor />
|
||||
<ContributorVo />
|
||||
|
||||
### ContentVo
|
||||
|
||||
@@ -61,5 +61,5 @@ import PostVo from "../vo/PostVo.md"
|
||||
|
||||
- [#CategoryVo](#categoryvo)
|
||||
- [#TagVo](#tagvo)
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
- [#ContentVo](#contentvo)
|
||||
|
@@ -5,7 +5,7 @@ description: tag.html - /tags/:slug
|
||||
|
||||
import CategoryVo from "../vo/CategoryVo.md"
|
||||
import TagVo from "../vo/TagVo.md"
|
||||
import Contributor from "../vo/Contributor.md";
|
||||
import ContributorVo from "../vo/ContributorVo.md";
|
||||
import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
## 路由信息
|
||||
@@ -72,9 +72,9 @@ import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
<TagVo />
|
||||
|
||||
### Contributor
|
||||
### ContributorVo
|
||||
|
||||
<Contributor />
|
||||
<ContributorVo />
|
||||
|
||||
### ListedPostVo
|
||||
|
||||
@@ -82,7 +82,7 @@ import ListedPostVo from "../vo/ListedPostVo.md"
|
||||
|
||||
- [#CategoryVo](#categoryvo)
|
||||
- [#TagVo](#tagvo)
|
||||
- [#Contributor](#contributor)
|
||||
- [#ContributorVo](#contributorvo)
|
||||
|
||||
### UrlContextListResult<ListedPostVo\>
|
||||
|
||||
|
@@ -1,8 +1,9 @@
|
||||
```json title="Contributor"
|
||||
```json title="ContributorVo"
|
||||
{
|
||||
"name": "string", // 用户名
|
||||
"displayName": "string", // 显示名称
|
||||
"avatar": "string", // 头像
|
||||
"bio": "string" // 描述
|
||||
"bio": "string", // 描述
|
||||
"permalink": "string" // 作者的文章归档页面链接
|
||||
}
|
||||
```
|
@@ -16,7 +16,7 @@
|
||||
"releaseSnapshot": "string",
|
||||
"headSnapshot": "string",
|
||||
"baseSnapshot": "string",
|
||||
"owner": "string", // 创建者名称,即 Contributor 的 metadata.name,非显示名称
|
||||
"owner": "string", // 创建者名称,即 ContributorVo 的 metadata.name,非显示名称
|
||||
"template": "string", // 自定义渲染模板
|
||||
"cover": "string", // 封面图
|
||||
"deleted": false,
|
||||
@@ -54,8 +54,8 @@
|
||||
},
|
||||
"categories": "List<#CategoryVo>", // 分类的集合
|
||||
"tags": "List<#TagVo>", // 标签的集合
|
||||
"contributors": "List<#Contributor>", // 贡献者的集合
|
||||
"owner": "#Contributor", // 创建者
|
||||
"contributors": "List<#ContributorVo>", // 贡献者的集合
|
||||
"owner": "#ContributorVo", // 创建者
|
||||
"stats": {
|
||||
"visit": 0, // 访问数量
|
||||
"upvote": 0, // 点赞数量
|
||||
|
@@ -16,7 +16,7 @@
|
||||
"releaseSnapshot": "string",
|
||||
"headSnapshot": "string",
|
||||
"baseSnapshot": "string",
|
||||
"owner": "string", // 创建者名称,即 Contributor 的 metadata.name,非显示名称
|
||||
"owner": "string", // 创建者名称,即 ContributorVo 的 metadata.name,非显示名称
|
||||
"template": "string", // 自定义渲染模板
|
||||
"cover": "string", // 封面图
|
||||
"deleted": false,
|
||||
@@ -51,7 +51,7 @@
|
||||
"upvote": 0, // 点赞数量
|
||||
"comment": 0 // 评论数量
|
||||
},
|
||||
"contributors": "List<#Contributor>", // 贡献者的集合
|
||||
"owner": "#Contributor" // 创建者
|
||||
"contributors": "List<#ContributorVo>", // 贡献者的集合
|
||||
"owner": "#ContributorVo" // 创建者
|
||||
}
|
||||
```
|
||||
|
@@ -16,7 +16,7 @@
|
||||
"releaseSnapshot": "string",
|
||||
"headSnapshot": "string",
|
||||
"baseSnapshot": "string",
|
||||
"owner": "string", // 创建者名称,即 Contributor 的 metadata.name,非显示名称
|
||||
"owner": "string", // 创建者名称,即 ContributorVo 的 metadata.name,非显示名称
|
||||
"template": "string", // 自定义渲染模板
|
||||
"cover": "string", // 封面图
|
||||
"deleted": false,
|
||||
@@ -54,8 +54,8 @@
|
||||
},
|
||||
"categories": "List<#CategoryVo>", // 分类的集合
|
||||
"tags": "List<#TagVo>", // 标签的集合
|
||||
"contributors": "List<#Contributor>", // 贡献者的集合
|
||||
"owner": "#Contributor", // 创建者
|
||||
"contributors": "List<#ContributorVo>", // 贡献者的集合
|
||||
"owner": "#ContributorVo", // 创建者
|
||||
"stats": {
|
||||
"visit": 0, // 访问数量
|
||||
"upvote": 0, // 点赞数量
|
||||
|
@@ -16,7 +16,7 @@
|
||||
"releaseSnapshot": "string",
|
||||
"headSnapshot": "string",
|
||||
"baseSnapshot": "string",
|
||||
"owner": "string", // 创建者名称,即 Contributor 的 metadata.name,非显示名称
|
||||
"owner": "string", // 创建者名称,即 ContributorVo 的 metadata.name,非显示名称
|
||||
"template": "string", // 自定义渲染模板
|
||||
"cover": "string", // 封面图
|
||||
"deleted": false,
|
||||
@@ -51,8 +51,8 @@
|
||||
"upvote": 0, // 点赞数量
|
||||
"comment": 0 // 评论数量
|
||||
},
|
||||
"contributors": "List<#Contributor>", // 贡献者的集合
|
||||
"owner": "#Contributor", // 创建者
|
||||
"contributors": "List<#ContributorVo>", // 贡献者的集合
|
||||
"owner": "#ContributorVo", // 创建者
|
||||
"content": "#ContentVo" // 内容
|
||||
}
|
||||
```
|
||||
|
@@ -0,0 +1,28 @@
|
||||
```json title="UserVo"
|
||||
{
|
||||
"metadata": {
|
||||
"name": "string", // 唯一标识
|
||||
"labels": {
|
||||
"additionalProp1": "string"
|
||||
},
|
||||
"annotations": {
|
||||
"additionalProp1": "string"
|
||||
},
|
||||
"creationTimestamp": "2022-11-20T13:06:38.512Z" // 创建时间
|
||||
},
|
||||
"spec": {
|
||||
"displayName": "string", // 显示名称
|
||||
"avatar": "string", // 头像链接
|
||||
"email": "string", // 邮箱地址
|
||||
"phone": "string", // 电话号码
|
||||
"bio": 0, // 描述
|
||||
"registeredAt": "2022-11-20T13:06:38.512Z", // 注册时间
|
||||
"twoFactorAuthEnabled": false, // 是否启用二次验证
|
||||
"disabled": false // 是否禁用
|
||||
},
|
||||
"status": {
|
||||
"lastLoginAt": "2022-11-20T13:06:38.512Z", // 最后登录时间
|
||||
"permalink": "string" // 作者的文章归档页面链接
|
||||
}
|
||||
}
|
||||
```
|
@@ -109,7 +109,8 @@
|
||||
"developer-guide/theme/template-variables/tags",
|
||||
"developer-guide/theme/template-variables/tag",
|
||||
"developer-guide/theme/template-variables/categories",
|
||||
"developer-guide/theme/template-variables/category"
|
||||
"developer-guide/theme/template-variables/category",
|
||||
"developer-guide/theme/template-variables/author"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@@ -109,7 +109,8 @@
|
||||
"developer-guide/theme/template-variables/tags",
|
||||
"developer-guide/theme/template-variables/tag",
|
||||
"developer-guide/theme/template-variables/categories",
|
||||
"developer-guide/theme/template-variables/category"
|
||||
"developer-guide/theme/template-variables/category",
|
||||
"developer-guide/theme/template-variables/author"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
Reference in New Issue
Block a user