feat: support friends page
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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=阅读更多
|
||||
|
||||
@@ -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=閱讀更多
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
@@ -15,3 +15,4 @@
|
||||
@use "toc";
|
||||
@use "sns";
|
||||
@use "typed-text";
|
||||
@use "friends";
|
||||
@@ -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}">< 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 ></span>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</nav>
|
||||
</th:block>
|
||||
</html>
|
||||
Reference in New Issue
Block a user