Files
theme-earth/templates/author.html
Ryan Wang 8bcc03b8b0 feat: add author archive template (#23)
添加作者页面,并将之前部分展示作者名称和头像的位置添加了作者访问链接。适配:https://github.com/halo-dev/halo/pull/2923

<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/207251573-cff9135c-6e0d-4af1-8db1-43bcfbbe2071.png">
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/207251627-69def72d-1f8f-4b78-b743-e2faddb71837.png">

/kind feature

```release-note
添加作者模板,支持根据作者归档文章。
```
2022-12-15 05:10:10 +00:00

49 lines
2.6 KiB
HTML

<!DOCTYPE html>
<html
xmlns:th="https://www.thymeleaf.org"
th:replace="~{modules/layout :: html(title = |作者:${author.spec.displayName} - ${site.title}|, header = ~{::header}, content = ~{::content}, head = null, footer = null, sidebar = null, contentClass = null)}"
>
<th:block th:fragment="header">
<th:block
th:replace="~{modules/header :: header(isHome = false, cover = ${theme.config.layout.header_background_image}, title = |作者:${author.spec.displayName}|)}"
/>
</th:block>
<th:block th:fragment="content">
<div
id="post-list"
th:if="${posts.total gt 0}"
th:with="postItems=${posts.items},list_layout=${theme.config.layout.post_list_layout}"
class="grid grid-cols-1 gap-6"
th:classappend="|${list_layout == 'grid_3' ? 'md:grid-cols-2 xl:grid-cols-3' : ''} ${list_layout == 'grid_2' ? 'md:grid-cols-2' : ''}|"
>
<th:block th:each="post : ${postItems}">
<th:block
th:replace="~{modules/post-card :: post-card(${post},true,true,true,${list_layout == 'single' ? 'column' : 'row'})}"
/>
</th:block>
</div>
<div th:if="${posts.total == 0}" class="mt-6 flex items-center justify-center">
<span class="text-sm font-light text-gray-600 dark:text-slate-200">此分类下没有文章</span>
</div>
<div class="mt-6 flex items-center justify-between" th:if="${posts.hasPrevious() || posts.hasNext()}">
<a
th:href="@{${posts.prevUrl}}"
class="whitespace-no-wrap group inline-flex items-center justify-center gap-1 rounded-md border border-gray-200 bg-white px-4 py-1 text-sm font-medium leading-6 text-gray-600 shadow-sm hover:bg-gray-50 focus:shadow-none focus:outline-none dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:hover:bg-slate-600 dark:hover:text-white"
>
<span class="i-tabler-arrow-left text-lg transition-all group-hover:-translate-x-1"></span>
<span>上一页</span>
</a>
<span class="text-sm text-gray-900 dark:text-slate-50" th:text="|${posts.page} / ${posts.totalPages}|"></span>
<a
th:href="@{${posts.nextUrl}}"
class="whitespace-no-wrap group inline-flex items-center justify-center gap-1 rounded-md border border-gray-200 bg-white px-4 py-1 text-sm font-medium leading-6 text-gray-600 shadow-sm hover:bg-gray-50 focus:shadow-none focus:outline-none dark:border-slate-600 dark:bg-slate-700 dark:text-slate-100 dark:hover:bg-slate-600 dark:hover:text-white"
>
<span>下一页</span>
<span class="i-tabler-arrow-right text-lg transition-all group-hover:translate-x-1"></span>
</a>
</div>
</th:block>
</html>