docs: add documentation for author template variables (#176)
	
		
	
				
					
				
			添加主题端作者归档页面的文档。后端改动可查阅:https://github.com/halo-dev/docs/issues/144 /kind documentation Fixes #143 ```release-note None ```JohnNiang-patch-1
							parent
							
								
									922502a9d3
								
							
						
					
					
						commit
						d13c86a5a7
					
				| @ -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) | ||||||
| @ -1,8 +1,9 @@ | |||||||
| ```json title="Contributor" | ```json title="ContributorVo" | ||||||
| { | { | ||||||
|   "name": "string",                                   // 用户名 |   "name": "string",                                   // 用户名 | ||||||
|   "displayName": "string",                            // 显示名称 |   "displayName": "string",                            // 显示名称 | ||||||
|   "avatar": "string",                                 // 头像 |   "avatar": "string",                                 // 头像 | ||||||
|   "bio": "string"                                     // 描述 |   "bio": "string",                                    // 描述 | ||||||
|  |   "permalink": "string"                               // 作者的文章归档页面链接 | ||||||
| } | } | ||||||
| ``` | ``` | ||||||
| @ -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"                               // 作者的文章归档页面链接 | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | ``` | ||||||
| @ -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) | ||||||
| @ -1,8 +1,9 @@ | |||||||
| ```json title="Contributor" | ```json title="ContributorVo" | ||||||
| { | { | ||||||
|   "name": "string",                                   // 用户名 |   "name": "string",                                   // 用户名 | ||||||
|   "displayName": "string",                            // 显示名称 |   "displayName": "string",                            // 显示名称 | ||||||
|   "avatar": "string",                                 // 头像 |   "avatar": "string",                                 // 头像 | ||||||
|   "bio": "string"                                     // 描述 |   "bio": "string",                                    // 描述 | ||||||
|  |   "permalink": "string"                               // 作者的文章归档页面链接 | ||||||
| } | } | ||||||
| ``` | ``` | ||||||
| @ -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"                               // 作者的文章归档页面链接 | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | ``` | ||||||
| @ -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) | ||||||
| @ -1,8 +1,9 @@ | |||||||
| ```json title="Contributor" | ```json title="ContributorVo" | ||||||
| { | { | ||||||
|   "name": "string",                                   // 用户名 |   "name": "string",                                   // 用户名 | ||||||
|   "displayName": "string",                            // 显示名称 |   "displayName": "string",                            // 显示名称 | ||||||
|   "avatar": "string",                                 // 头像 |   "avatar": "string",                                 // 头像 | ||||||
|   "bio": "string"                                     // 描述 |   "bio": "string",                                    // 描述 | ||||||
|  |   "permalink": "string"                               // 作者的文章归档页面链接 | ||||||
| } | } | ||||||
| ``` | ``` | ||||||
| @ -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"                               // 作者的文章归档页面链接 | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | ``` | ||||||
					Loading…
					
					
				
		Reference in new issue