跳到主要内容
版本:2.14

作者归档

路由信息

  • 模板路径:/templates/author.html
  • 访问路径:/authors/:name

变量

author

变量类型

#UserVo

posts

变量类型

#UrlContextListResult<ListedPostVo>

示例

/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
{
"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" // 作者的文章归档页面链接
}
}

CategoryVo

CategoryVo
{
"metadata": {
"name": "string", // 唯一标识
"labels": {
"additionalProp1": "string"
},
"annotations": {
"additionalProp1": "string"
},
"creationTimestamp": "2022-11-20T13:06:38.512Z", // 创建时间
},
"spec": {
"displayName": "string", // 显示名称
"slug": "string", // 别名,通常用于生成 status.permalink
"description": "string", // 描述
"cover": "string", // 封面图
"template": "string", // 自定义渲染模板名称
"priority": 0, // 排序字段
"children": [ // 下级分类,分类的 metadata.name 集合
"string"
]
},
"status": {
"permalink": "string", // 固定链接
"postCount": 0, // 文章数
"visiblePostCount": 0 // 已发布文章数
},
"postCount": 0
}

TagVo

TagVo
{
"metadata": {
"name": "string", // 唯一标识
"labels": {
"additionalProp1": "string"
},
"annotations": {
"additionalProp1": "string"
},
"creationTimestamp": "2022-11-20T13:06:38.512Z", // 创建时间
},
"spec": {
"displayName": "string", // 显示名称
"slug": "string", // 别名,通常用于生成 status.permalink
"color": "#F9fEB1", // 背景颜色
"cover": "string" // 封面图
},
"status": {
"permalink": "string", // 固定链接
"visiblePostCount": 0, // 已发布文章数
"postCount": 0 // 文章数
},
"postCount": 0
}

ContributorVo

ContributorVo
{
"name": "string", // 用户名
"displayName": "string", // 显示名称
"avatar": "string", // 头像
"bio": "string", // 描述
"permalink": "string", // 作者的文章归档页面链接
"metadata": {
"name": "string", // 唯一标识
"labels": {
"additionalProp1": "string"
},
"annotations": {
"additionalProp1": "string"
},
"creationTimestamp": "2022-11-20T13:06:38.512Z", // 创建时间
}
}

ListedPostVo

<ListedPostVo />

UrlContextListResult<ListedPostVo>

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" // 上一页链接
}