feat: support friends page

This commit is contained in:
Erzbir
2026-04-09 14:18:03 +08:00
parent 41a9ddacf1
commit 1a3fe6bb26
8 changed files with 88 additions and 1 deletions
+1
View File
@@ -5,6 +5,7 @@ page.tags.title=Tags
page.tag.title=Tag
page.categories.title=Categories
page.category.title=Category
page.friends.title=Friends
page.pagination.prev=Prev
page.pagination.next=Next
page.post.more=READ MORE
+1
View File
@@ -5,6 +5,7 @@ page.tags.title=Tags
page.tag.title=Tag
page.categories.title=Categories
page.category.title=Category
page.friends.title=Friends
page.pagination.prev=Prev
page.pagination.next=Next
page.post.more=READ MORE
+1
View File
@@ -5,6 +5,7 @@ page.tags.title=Etiquetas
page.tag.title=Etiqueta
page.categories.title=Categorías
page.category.title=Categoría
page.friends.title=Amigos
page.pagination.prev=Anterior
page.pagination.next=Siguiente
page.post.more=LEER MÁS
+1
View File
@@ -5,6 +5,7 @@ page.tags.title=标签
page.tag.title=标签
page.categories.title=分类
page.category.title=分类
page.friends.title=朋友
page.pagination.prev=上一页
page.pagination.next=下一页
page.post.more=阅读更多
+1
View File
@@ -5,6 +5,7 @@ page.tags.title=標籤
page.tag.title=標籤
page.categories.title=分類
page.category.title=分類
page.friends.title=朋友
page.pagination.prev=上一頁
page.pagination.next=下一頁
page.post.more=閱讀更多
+28
View File
@@ -0,0 +1,28 @@
.friend-post-list {
padding: 0;
}
.friend-post-title {
margin-bottom: calc(var(--size-theme-font) * .3125);
padding: 0;
}
.friend-post-meta {
margin-bottom: calc(var(--size-theme-font) * .3125);
padding: 0;
}
.friend-author {
display: inline-flex;
align-items: center;
gap: calc(var(--size-theme-font) * 0.35);
color: var(--color-theme-meta);
text-decoration: none;
}
.friend-post-desc {
margin: 0;
padding: 0;
color: var(--color-theme-foreground);
font-size: calc(var(--size-theme-font) * 0.875);
}
+2 -1
View File
@@ -14,4 +14,5 @@
@use "theme";
@use "toc";
@use "sns";
@use "typed-text";
@use "typed-text";
@use "friends";
+53
View File
@@ -0,0 +1,53 @@
<!DOCTYPE html>
<html
xmlns:th="https://www.thymeleaf.org"
th:replace="~{modules/layout :: html(title = |#{page.friends.title} - ${site.title}|, header = null, content = ~{::content}, footer = null)}"
>
<th:block th:fragment="content">
<article class="post">
<header>
<h1 class="post-title" th:text="#{page.friends.title}">Friends</h1>
</header>
<div>
<th:block th:each="friend, iterStat : ${friends.items}" th:with="spec = ${friend.spec}">
<h2 th:if="${iterStat.first
or (#temporals.format(spec.pubDate, 'yyyy-MM-dd') != #temporals.format(friends.items[iterStat.index - 1].spec.pubDate, 'yyyy-MM-dd'))}"
th:text="${#temporals.format(spec.pubDate, 'yyyy-MM-dd')}">
</h2>
<ul>
<li class="post-list friend-post-list">
<a th:href="@{${spec.postLink}}" target="_blank" rel="noopener noreferrer">
<h2 class="post-list-title friend-post-title" th:text="${spec.title}">Post Title</h2>
</a>
<div class="post-meta friend-post-meta">
<a class="friend-author" th:href="@{${spec.authorUrl}}" target="_blank"
rel="noopener noreferrer">
<span class="post-author" th:text="${spec.author}">Author</span>
</a>
</div>
<p class="friend-post-desc" th:if="${spec.description}" th:text="${spec.description}"></p>
</li>
</ul>
</th:block>
</div>
</article>
<nav class="pagination" th:if="${friends.hasPrevious() || friends.hasNext()}">
<div class="pagination__buttons">
<span th:if="${friends.hasPrevious()}">
<a data-pjax th:href="@{${friends.prevUrl}}" class="button prev inline">
<span class="button__text" th:text="'< ' + #{page.pagination.prev}">&lt;&nbsp;Prev</span>
</a>
</span>
<span th:if="${friends.hasNext()}">
<a data-pjax th:href="@{${friends.nextUrl}}" class="button inline next">
<span class="button__text" th:text="#{page.pagination.next} + ' >'">Next&nbsp;&gt;</span>
</a>
</span>
</div>
</nav>
</th:block>
</html>