style: refactor layout

This commit is contained in:
Erzbir
2025-08-10 17:21:56 +08:00
parent 9cf5c1540a
commit 66034a343f
16 changed files with 105 additions and 120 deletions
+1 -1
View File
@@ -9,5 +9,5 @@ page.pagination.prev=Prev
page.pagination.next=Next page.pagination.next=Next
page.post.more=READ MORE page.post.more=READ MORE
page.post.pagination=READ MORE POSTS page.post.pagination=READ MORE POSTS
page.post.comment=Comment page.post.comment=Comments
page.error.back=Back to home page page.error.back=Back to home page
+1 -1
View File
@@ -9,5 +9,5 @@ page.pagination.prev=Prev
page.pagination.next=Next page.pagination.next=Next
page.post.more=READ MORE page.post.more=READ MORE
page.post.pagination=READ MORE POSTS page.post.pagination=READ MORE POSTS
page.post.comment=Comment page.post.comment=Comments
page.error.back=Back to home page page.error.back=Back to home page
+1 -1
View File
@@ -9,5 +9,5 @@ page.pagination.prev=Anterior
page.pagination.next=Siguiente page.pagination.next=Siguiente
page.post.more=LEER MÁS page.post.more=LEER MÁS
page.post.pagination=LEER MÁS PUBLICACIONES page.post.pagination=LEER MÁS PUBLICACIONES
page.post.comment=Comentario page.post.comment=Comentarios
page.error.back=Volver a la página principal page.error.back=Volver a la página principal
+4 -21
View File
@@ -67,34 +67,18 @@ body {
} }
} }
.page { .wrapper {
margin: 0 auto;
display: flex; display: flex;
flex-direction: column; flex-direction: row;
min-height: 100vh
}
.main-wrapper {
flex: 1;
display: flex;
flex-direction: column;
}
.layout-wrapper {
display: flex;
width: 100%;
flex: 1;
} }
.sidebar-left, .sidebar-left,
.sidebar-right { .sidebar-right {
width: 20%; width: 20%;
flex-shrink: 0;
padding: calc(var(--font-theme-size) * 1.25); padding: calc(var(--font-theme-size) * 1.25);
} }
.center.container { .container {
flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
padding: calc(var(--font-theme-size) * 2.5); padding: calc(var(--font-theme-size) * 2.5);
@@ -103,7 +87,6 @@ body {
} }
.content { .content {
flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
@@ -116,7 +99,7 @@ body {
} }
@media (max-width: 768px) { @media (max-width: 768px) {
.center.container { .container {
padding: calc(var(--font-theme-size) * 1.25); padding: calc(var(--font-theme-size) * 1.25);
} }
} }
+5 -5
View File
@@ -8,13 +8,13 @@
<header> <header>
<h1 class="post-title" th:text="#{page.archives.title}">Archives</h1> <h1 class="post-title" th:text="#{page.archives.title}">Archives</h1>
</header> </header>
<section> <div>
<th:block th:each="archive : ${archives.items}"> <th:block th:each="archive : ${archives.items}">
<ul> <ul>
<th:block th:each="month : ${archive.months}"> <th:block th:each="month : ${archive.months}">
<li class="post-list" th:each="post : ${month.posts}"> <li class="post-list" th:each="post : ${month.posts}">
<a data-pjax th:href="@{${post.status.permalink}}"> <a data-pjax th:href="@{${post.status.permalink}}">
<span th:text="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}">Publish Time</span> <time th:text="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}">Publish Time</time>
<span>&nbsp;::&nbsp;</span> <span>&nbsp;::&nbsp;</span>
<span class="post-list-title" th:text="${post.spec.title}">Post Title</span> <span class="post-list-title" th:text="${post.spec.title}">Post Title</span>
</a> </a>
@@ -22,9 +22,9 @@
</th:block> </th:block>
</ul> </ul>
</th:block> </th:block>
</section> </div>
</article> </article>
<div class="pagination" th:if="${archives.hasPrevious() || archives.hasNext()}"> <nav class="pagination" th:if="${archives.hasPrevious() || archives.hasNext()}">
<div class="pagination__buttons"> <div class="pagination__buttons">
<span th:if="${archives.hasPrevious()}"> <span th:if="${archives.hasPrevious()}">
<a data-pjax th:href="@{${archives.prevUrl}}" class="button prev inline"> <a data-pjax th:href="@{${archives.prevUrl}}" class="button prev inline">
@@ -38,6 +38,6 @@
</a> </a>
</span> </span>
</div> </div>
</div> </nav>
</th:block> </th:block>
</html> </html>
+2 -2
View File
@@ -8,11 +8,11 @@
<header> <header>
<h1 class="post-title" th:text="#{page.categories.title}">Categories</h1> <h1 class="post-title" th:text="#{page.categories.title}">Categories</h1>
</header> </header>
<section class="post-content"> <div class="post-content">
<ul> <ul>
<li th:replace="~{modules/category-tree :: single(categories=${categories})}"></li> <li th:replace="~{modules/category-tree :: single(categories=${categories})}"></li>
</ul> </ul>
</section> </div>
</article> </article>
</th:block> </th:block>
</html> </html>
+11 -11
View File
@@ -11,7 +11,7 @@
Category: Category name [n] Category: Category name [n]
</h1> </h1>
</header> </header>
<section class="post-content"> <div class="post-content">
<ul> <ul>
<li class="post-list" th:each="post : ${posts.items}"> <li class="post-list" th:each="post : ${posts.items}">
<a data-pjax th:href="@{${post.status.permalink}}"> <a data-pjax th:href="@{${post.status.permalink}}">
@@ -21,21 +21,21 @@
</a> </a>
</li> </li>
</ul> </ul>
</section> </div>
</article> </article>
<section class="pagination" th:if="${posts.hasPrevious() || posts.hasNext()}"> <nav class="pagination" th:if="${posts.hasPrevious() || posts.hasNext()}">
<div class="pagination__buttons" th:with="postCursor=${postFinder.cursor(post.metadata?.name)}"> <div class="pagination__buttons">
<span th:if="${postCursor.hasPrevious()}"> <span th:if="${posts.hasPrevious()}">
<a data-pjax th:href="@{${postCursor.previous?.status?.permalink}}" class="button prev inline"> <a data-pjax th:href="@{${posts.prevUrl}}" class="button inline prev">
<span class="button__text" th:text="|< ${postCursor.previous?.spec?.title}|">prevPost</span> <span class="button__text" th:text="'< ' + #{page.pagination.prev}">&lt;&nbsp;Prev</span>
</a> </a>
</span> </span>
<span th:if="${postCursor.hasNext()}"> <span th:if="${posts.hasNext()}">
<a data-pjax th:href="@{${postCursor.next?.status?.permalink}}" class="button next inline"> <a data-pjax th:href="@{${posts.nextUrl}}" class="button inline next">
<span class="button__text" th:text="|${postCursor.next?.spec?.title} >|">nextPost</span> <span class="button__text" th:text="#{page.pagination.next} + ' >'">Next&nbsp;&gt;</span>
</a> </a>
</span> </span>
</div> </div>
</section> </nav>
</th:block> </th:block>
</html> </html>
+12 -12
View File
@@ -14,31 +14,31 @@
<h1 class="post-title"> <h1 class="post-title">
<a data-pjax th:text="${post.spec.title}" th:href="@{${post.status.permalink}}">Post Title</a> <a data-pjax th:text="${post.spec.title}" th:href="@{${post.status.permalink}}">Post Title</a>
</h1> </h1>
<section class="post-meta"> <div class="post-meta">
<span class="post-date" <time class="post-date"
th:text="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}">Publish Time</span> th:text="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}">Publish Time</time>
<span class="post-author" <span class="post-author"
th:with="contributor = ${post.contributors[0]}" th:with="contributor = ${post.contributors[0]}"
th:text="${contributor.displayName}">Author</span> th:text="${contributor.displayName}">Author</span>
</section> </div>
<section class="post-tags"> <div class="post-tags">
<span class="post-tag" th:each="tag : ${post.tags}"> <span class="post-tag" th:each="tag : ${post.tags}">
<a data-pjax <a data-pjax
th:href="@{${tag.status.permalink}}" th:href="@{${tag.status.permalink}}"
th:title="${tag.spec.displayName}" th:title="${tag.spec.displayName}"
th:text="'#'+${tag.spec.displayName}">#Tag</a> th:text="'#'+${tag.spec.displayName}">#Tag</a>
</span> </span>
</section> </div>
</header> </header>
<section class="post-excerpt"> <div class="post-excerpt">
<span th:text="${post.status.excerpt}">Post Excerpt...</span> <span th:text="${post.status.excerpt}">Post Excerpt...</span>
</section> </div>
<section> <div>
<a data-pjax class="read-more button inline" th:href="@{${post.status.permalink}}" th:text="#{page.post.more} + ' >'">READ MORE ></a> <a data-pjax class="read-more button inline" th:href="@{${post.status.permalink}}" th:text="#{page.post.more} + ' >'">READ MORE ></a>
</section> </div>
</article> </article>
</section> </section>
<section class="pagination" th:if="${posts.hasPrevious() || posts.hasNext()}"> <nav class="pagination" th:if="${posts.hasPrevious() || posts.hasNext()}">
<div class="pagination__buttons"> <div class="pagination__buttons">
<span th:if="${posts.hasPrevious()}"> <span th:if="${posts.hasPrevious()}">
<a data-pjax th:href="@{${posts.prevUrl}}" class="button inline prev"> <a data-pjax th:href="@{${posts.prevUrl}}" class="button inline prev">
@@ -51,6 +51,6 @@
</a> </a>
</span> </span>
</div> </div>
</section> </nav>
</th:block> </th:block>
</html> </html>
+6
View File
@@ -0,0 +1,6 @@
<th:block th:fragment="comment(group, kind, name)">
<section class="comment" th:attr="name=${name},kind=${kind},group=${group}">
<h2 th:text="#{page.post.comment}">Comments</h2>
<halo:comment th:attr="name=${name},kind=${kind},group=${group}"/>
</section>
</th:block>
+4 -4
View File
@@ -1,6 +1,6 @@
<th:block th:fragment="footer"> <th:block th:fragment="footer">
<div class="footer-inner"> <div class="footer-inner">
<section class="footer-copyright-engine"> <div class="footer-copyright-engine">
<span>Powered by&nbsp;</span> <span>Powered by&nbsp;</span>
<span> <span>
<a target="_blank" href="http://www.halo.run">Halo</a> <a target="_blank" href="http://www.halo.run">Halo</a>
@@ -8,8 +8,8 @@
<span>&nbsp;::&nbsp;</span> <span>&nbsp;::&nbsp;</span>
<span>Theme&nbsp;</span> <span>Theme&nbsp;</span>
<a target="_blank" href="https://github.com/Erzbir/halo-theme-terminal">Terminal</a> <a target="_blank" href="https://github.com/Erzbir/halo-theme-terminal">Terminal</a>
</section> </div>
<section class="footer-copyright-site"> <div class="footer-copyright-site">
<div class="footer-user"> <div class="footer-user">
<span>©&nbsp;</span> <span>©&nbsp;</span>
<span th:text="${#dates.year(#dates.createNow())}">2025</span> <span th:text="${#dates.year(#dates.createNow())}">2025</span>
@@ -31,7 +31,7 @@
</p> </p>
</div> </div>
</section> </div>
</div> </div>
<halo:footer/> <halo:footer/>
</th:block> </th:block>
+7 -9
View File
@@ -77,14 +77,13 @@
<body> <body>
<div class="page"> <div class="page">
<header> <header role="banner">
<div id="header-slot"></div> <div id="header-slot" aria-hidden="true"></div>
</header> </header>
<div class="main-wrapper"> <div class="wrapper">
<div class="layout-wrapper">
<aside class="sidebar-left"> <aside class="sidebar-left">
</aside> </aside>
<main class="center container"> <main class="container" role="main">
<header class="header"> <header class="header">
<th:block th:replace="~{modules/header :: header(isHome = true)}"/> <th:block th:replace="~{modules/header :: header(isHome = true)}"/>
</header> </header>
@@ -95,11 +94,10 @@
<aside class="sidebar-right"> <aside class="sidebar-right">
</aside> </aside>
</div> </div>
</div> <footer class="footer" role="contentinfo">
<footer class="footer"> <div id="footer-slot-fist" aria-hidden="true"></div>
<div id="footer-slot-fist"></div>
<th:block th:replace="~{modules/footer}"/> <th:block th:replace="~{modules/footer}"/>
<div id="footer-slot-last"></div> <div id="footer-slot-last" aria-hidden="true"></div>
</footer> </footer>
</div> </div>
</body> </body>
+6 -6
View File
@@ -11,15 +11,15 @@
th:attr="x-data=|{name:'${moment.metadata.name}',showComment:false}|"> th:attr="x-data=|{name:'${moment.metadata.name}',showComment:false}|">
<header> <header>
<div class="post-meta"> <div class="post-meta">
<span class="post-date" th:text="${#dates.format(moment.spec.releaseTime,'yyyy-MM-dd')}"> <time class="post-date" th:text="${#dates.format(moment.spec.releaseTime,'yyyy-MM-dd')}">
Moment CreateTime Moment CreateTime
</span> </time>
<span class="post-author" th:with="owner = ${moment.owner}" th:text="${owner.displayName}"> <span class="post-author" th:with="owner = ${moment.owner}" th:text="${owner.displayName}">
Author Author
</span> </span>
</div> </div>
</header> </header>
<section class="post-content" th:utext="${content.html}">Moment Content...</section> <div class="post-content" th:utext="${content.html}">Moment Content...</div>
<th:block th:with="medium=${moment.spec.content.medium}"> <th:block th:with="medium=${moment.spec.content.medium}">
<div <div
th:unless="${#lists.isEmpty(moments)}" th:unless="${#lists.isEmpty(moments)}"
@@ -32,7 +32,7 @@
th:if="${#strings.equals(media.type,'PHOTO')}" th:if="${#strings.equals(media.type,'PHOTO')}"
class="transform-gpu rounded-lg object-cover" class="transform-gpu rounded-lg object-cover"
th:src="${media.url}" th:src="${media.url}"
/> alt="photo"/>
</a> </a>
<div th:if="${#strings.equals(media.type,'VIDEO')}"> <div th:if="${#strings.equals(media.type,'VIDEO')}">
<video controls th:src="${media.url}"></video> <video controls th:src="${media.url}"></video>
@@ -41,7 +41,7 @@
</div> </div>
</th:block> </th:block>
</article> </article>
<section class="pagination" th:if="${moments.hasPrevious() || moments.hasNext()}"> <nav class="pagination" th:if="${moments.hasPrevious() || moments.hasNext()}">
<div class="pagination__buttons"> <div class="pagination__buttons">
<span th:if="${moments.hasPrevious()}"> <span th:if="${moments.hasPrevious()}">
<a data-pjax th:href="@{${moments.prevUrl}}" class="button inline prev"> <a data-pjax th:href="@{${moments.prevUrl}}" class="button inline prev">
@@ -54,6 +54,6 @@
</a> </a>
</span> </span>
</div> </div>
</section> </nav>
</th:block> </th:block>
</html> </html>
+5 -6
View File
@@ -8,13 +8,12 @@
<header> <header>
<h1 class="post-title" th:text="${singlePage.spec.title}">Post Title</h1> <h1 class="post-title" th:text="${singlePage.spec.title}">Post Title</h1>
</header> </header>
<section class="post-content"> <div class="post-content">
<div th:utext="${singlePage.content.content}">Post Content</div> <div th:utext="${singlePage.content.content}">Post Content</div>
</section> </div>
</article> </article>
<section class="comment" th:if="${haloCommentEnabled}"> <th:block
<h2>Comments</h2> th:replace="~{modules/comment :: comment(group = 'content.halo.run', kind = 'SinglePage', name = ${singlePage.metadata.name})}"
<halo:comment group="content.halo.run" kind="SinglePage" th:attr="name=${singlePage.metadata.name}"/> th:if="${haloCommentEnabled}"/>
</section>
</th:block> </th:block>
</html> </html>
+9 -10
View File
@@ -8,8 +8,9 @@
<header> <header>
<h1 class="post-title" th:text="${post.spec.title}">Post Title</h1> <h1 class="post-title" th:text="${post.spec.title}">Post Title</h1>
<div class="post-meta"> <div class="post-meta">
<span class="post-date" <time class="post-date"
th:text="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}">Publish Time</span> th:text="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}">Publish Time
</time>
<span class="post-author" th:text="${post.owner.displayName}">Author</span> <span class="post-author" th:text="${post.owner.displayName}">Author</span>
</div> </div>
<span class="post-tags"> <span class="post-tags">
@@ -18,8 +19,7 @@
th:href="@{${tag.status.permalink}}" th:href="@{${tag.status.permalink}}"
th:title="${tag.spec.displayName}" th:title="${tag.spec.displayName}"
th:text="'#'+${tag.spec.displayName}" th:text="'#'+${tag.spec.displayName}"
>#Tag >#Tag</a>
</a>
</span> </span>
</span> </span>
</header> </header>
@@ -31,7 +31,7 @@
<button id="toc-toggle" class="toc-toggle" aria-label="Hide Table of Contents"></button> <button id="toc-toggle" class="toc-toggle" aria-label="Hide Table of Contents"></button>
<div id="toc-content" class="toc-content"></div> <div id="toc-content" class="toc-content"></div>
</nav> </nav>
<section class="pagination"> <nav class="pagination">
<div class="pagination__title"> <div class="pagination__title">
<span class="pagination__title-h" th:text="#{page.post.pagination}">READ OTHER POSTS</span> <span class="pagination__title-h" th:text="#{page.post.pagination}">READ OTHER POSTS</span>
<hr/> <hr/>
@@ -48,10 +48,9 @@
</a> </a>
</span> </span>
</div> </div>
</section> </nav>
<section class="comment" th:if="${haloCommentEnabled}"> <th:block
<h2 th:text="#{page.post.comment}">Comments</h2> th:replace="~{modules/comment :: comment(group = 'content.halo.run', kind = 'Post', name = ${post.metadata.name})}"
<halo:comment group="content.halo.run" kind="Post" th:attr="name=${post.metadata.name}"/> th:if="${haloCommentEnabled}"/>
</section>
</th:block> </th:block>
</html> </html>
+5 -5
View File
@@ -11,19 +11,19 @@
Tag: Tag name [n] Tag: Tag name [n]
</h1> </h1>
</header> </header>
<section class="post-content"> <div class="post-content">
<ul> <ul>
<li class="post-list" th:each="post : ${posts.items}"> <li class="post-list" th:each="post : ${posts.items}">
<a data-pjax th:href="@{${post.status.permalink}}"> <a data-pjax th:href="@{${post.status.permalink}}">
<span th:text="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}">Publish Time</span> <time th:text="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}">Publish Time</time>
<span>&nbsp;::&nbsp;</span> <span>&nbsp;::&nbsp;</span>
<span class="post-list-title" th:text="${post.spec.title}">Post Title</span> <span class="post-list-title" th:text="${post.spec.title}">Post Title</span>
</a> </a>
</li> </li>
</ul> </ul>
</section> </div>
</article> </article>
<section class="pagination" th:if="${posts.hasPrevious() || posts.hasNext()}"> <nav class="pagination" th:if="${posts.hasPrevious() || posts.hasNext()}">
<div class="pagination__buttons"> <div class="pagination__buttons">
<span th:if="${posts.hasPrevious()}"> <span th:if="${posts.hasPrevious()}">
<a data-pjax th:href="@{${posts.prevUrl}}" class="button inline prev"> <a data-pjax th:href="@{${posts.prevUrl}}" class="button inline prev">
@@ -36,6 +36,6 @@
</a> </a>
</span> </span>
</div> </div>
</section> </nav>
</th:block> </th:block>
</html> </html>
+2 -2
View File
@@ -8,7 +8,7 @@
<header> <header>
<h1 class="post-title" th:text="#{page.tag.title}">Tags</h1> <h1 class="post-title" th:text="#{page.tag.title}">Tags</h1>
</header> </header>
<section class="post-content"> <div class="post-content">
<ul> <ul>
<li th:each="tag: ${tags}"> <li th:each="tag: ${tags}">
<a data-pjax th:href="@{${tag.status.permalink}}" <a data-pjax th:href="@{${tag.status.permalink}}"
@@ -17,7 +17,7 @@
<span th:text="' ['+${tag.status.visiblePostCount?:0}+']'"></span> <span th:text="' ['+${tag.status.visiblePostCount?:0}+']'"></span>
</li> </li>
</ul> </ul>
</section> </div>
</article> </article>
</th:block> </th:block>
</html> </html>