Merge pull request #12 from exyone-js/main

为halo作品集插件添加/portfolio路由
This commit is contained in:
Erzbir
2026-06-29 16:15:21 +08:00
committed by GitHub
9 changed files with 471 additions and 5 deletions
+14 -1
View File
@@ -11,4 +11,17 @@ 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=Comments page.post.comment=Comments
page.error.back=Back to home page page.error.back=Back to home page
page.portfolio.title=Portfolio
page.portfolio.empty=No projects found.
page.portfolio.featured=Featured
page.portfolio.detail=Detail
page.portfolio.repository=Repository
page.portfolio.demo=Demo
page.portfolio.docs=Docs
page.portfolio.links=Links
page.portfolio.back=Portfolio
page.portfolio.tech_stack=Tech Stack
page.portfolio.tags=Tags
page.portfolio.description=Description
page.portfolio.content=Content
+14 -1
View File
@@ -11,4 +11,17 @@ 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=Comments page.post.comment=Comments
page.error.back=Back to home page page.error.back=Back to home page
page.portfolio.title=Portfolio
page.portfolio.empty=No projects found.
page.portfolio.featured=Featured
page.portfolio.detail=Detail
page.portfolio.repository=Repository
page.portfolio.demo=Demo
page.portfolio.docs=Docs
page.portfolio.links=Links
page.portfolio.back=Portfolio
page.portfolio.tech_stack=Tech Stack
page.portfolio.tags=Tags
page.portfolio.description=Description
page.portfolio.content=Content
+14 -1
View File
@@ -11,4 +11,17 @@ 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=Comentarios page.post.comment=Comentarios
page.error.back=Volver a la página principal page.error.back=Volver a la página principal
page.portfolio.title=Portafolio
page.portfolio.empty=No se encontraron proyectos.
page.portfolio.featured=Destacado
page.portfolio.detail=Detalles
page.portfolio.repository=Repositorio
page.portfolio.demo=Demo
page.portfolio.docs=Documentación
page.portfolio.links=Enlaces
page.portfolio.back=Portafolio
page.portfolio.tech_stack=Tecnologías
page.portfolio.tags=Etiquetas
page.portfolio.description=Descripción
page.portfolio.content=Contenido
+14 -1
View File
@@ -11,4 +11,17 @@ page.pagination.next=下一页
page.post.more=阅读更多 page.post.more=阅读更多
page.post.pagination=更多文章 page.post.pagination=更多文章
page.post.comment=评论 page.post.comment=评论
page.error.back=返回首页 page.error.back=返回首页
page.portfolio.title=项目作品集
page.portfolio.empty=暂无项目
page.portfolio.featured=推荐
page.portfolio.detail=详情
page.portfolio.repository=仓库
page.portfolio.demo=演示
page.portfolio.docs=文档
page.portfolio.links=链接
page.portfolio.back=项目集
page.portfolio.tech_stack=技术栈
page.portfolio.tags=标签
page.portfolio.description=说明
page.portfolio.content=详细内容
+13
View File
@@ -12,3 +12,16 @@ page.post.more=閱讀更多
page.post.pagination=閱讀更多文章 page.post.pagination=閱讀更多文章
page.post.comment=評論 page.post.comment=評論
page.error.back=返回首頁 page.error.back=返回首頁
page.portfolio.title=項目作品集
page.portfolio.empty=暫無項目
page.portfolio.featured=推薦
page.portfolio.detail=詳情
page.portfolio.repository=倉庫
page.portfolio.demo=演示
page.portfolio.docs=文件
page.portfolio.links=連結
page.portfolio.back=項目集
page.portfolio.tech_stack=技術堆疊
page.portfolio.tags=標籤
page.portfolio.description=說明
page.portfolio.content=詳細內容
+227
View File
@@ -0,0 +1,227 @@
@use "variables" as *;
.portfolio-page {
width: 100%;
text-align: left;
padding: calc(var(--size-theme-font) * 1.875) 0;
}
.portfolio-list {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: calc(var(--size-theme-font) * 0.875);
margin-top: calc(var(--size-theme-font) * 0.625);
}
.portfolio-list > .portfolio-item.post {
display: flex;
flex-direction: column;
min-width: 0;
padding: calc(var(--size-theme-font) * 0.875);
border: calc(var(--size-theme-font) * 0.0625) var(--style-theme-border) var(--color-theme-framed);
}
.portfolio-card-cover {
display: block;
margin-bottom: calc(var(--size-theme-font) * 0.75);
}
.portfolio-card-cover img {
width: 100%;
aspect-ratio: 16 / 9;
object-fit: cover;
margin: 0;
}
.portfolio-card-labels {
display: flex;
flex-wrap: wrap;
gap: 0 1ch;
margin-bottom: calc(var(--size-theme-font) * 0.45);
}
.portfolio-card-label {
color: var(--color-theme-tag);
font-size: calc(var(--size-theme-font) * 0.86);
line-height: calc(var(--size-theme-font) * 1.4);
}
.portfolio-item .post-title {
font-size: calc(var(--size-theme-font) * 1.05);
margin-bottom: calc(var(--size-theme-font) * 0.5) !important;
padding-bottom: calc(var(--size-theme-font) * 0.5) !important;
}
.portfolio-item .post-meta {
margin-bottom: 0;
}
.portfolio-meta {
display: flex;
flex-direction: column;
gap: calc(var(--size-theme-font) * 0.2);
}
.portfolio-meta > * {
display: block;
}
.portfolio-meta > *::before,
.portfolio-meta > *:not(:first-child):not(:empty)::before {
content: none;
margin-right: 0;
}
.portfolio-meta-line,
.portfolio-techs,
.portfolio-tags {
line-height: calc(var(--size-theme-font) * 1.45);
}
.portfolio-meta-group {
display: block;
}
.portfolio-detail-post .portfolio-meta-group {
display: inline;
}
.portfolio-meta .portfolio-term,
.portfolio-meta .portfolio-card-label,
.portfolio-meta .portfolio-tag {
display: inline-block;
}
.portfolio-meta .portfolio-term {
color: var(--color-theme-accent);
}
.portfolio-meta .portfolio-term:not(:last-child),
.portfolio-meta .portfolio-card-label:not(:last-child),
.portfolio-meta .portfolio-tag:not(:last-child) {
margin-right: 1ch;
}
.portfolio-item .portfolio-tags,
.portfolio-item .portfolio-tags .portfolio-tag {
color: color-mix(in srgb, var(--color-theme-accent) 72%, transparent);
}
.portfolio-detail-post .portfolio-meta-line,
.portfolio-detail-post .portfolio-meta-line .portfolio-card-label,
.portfolio-detail-post .portfolio-meta-line .portfolio-tag {
color: color-mix(in srgb, var(--color-theme-meta) 72%, transparent);
}
.portfolio-detail-post .portfolio-meta-line.post-meta {
margin-bottom: 0;
}
.portfolio-detail-post .portfolio-techs,
.portfolio-detail-post .portfolio-techs .portfolio-term {
color: var(--color-theme-accent);
}
.portfolio-item .post-excerpt {
color: color-mix(in srgb, var(--color-theme-foreground) 82%, transparent);
font-size: calc(var(--size-theme-font) * 0.86);
line-height: calc(var(--size-theme-font) * 1.55);
margin-top: calc(var(--size-theme-font) * 0.625);
margin-bottom: 0;
}
.portfolio-actions {
display: flex;
flex-wrap: wrap;
gap: 0 1.5ch;
margin-top: auto;
padding-top: calc(var(--size-theme-font) * 0.625);
a {
white-space: nowrap;
}
}
.portfolio-action {
color: var(--color-theme-accent);
font-size: calc(var(--size-theme-font) * 0.92);
}
.portfolio-action::before {
content: "[ ";
color: var(--color-theme-accent);
}
.portfolio-action::after {
content: " ]";
color: var(--color-theme-accent);
}
.portfolio-empty {
color: color-mix(in srgb, var(--color-theme-foreground) 65%, transparent);
}
.portfolio-detail-nav {
margin-top: calc(var(--size-theme-font) * 1.5625);
}
.portfolio-detail-cover {
width: auto;
max-width: 100%;
height: auto;
object-fit: contain;
}
.portfolio-detail-summary {
color: color-mix(in srgb, var(--color-theme-foreground) 86%, transparent);
}
.portfolio-detail-section {
margin-top: calc(var(--size-theme-font) * 1.5625);
h2 {
margin-bottom: calc(var(--size-theme-font) * 0.625);
}
}
.portfolio-link-list {
margin-top: calc(var(--size-theme-font) * 0.625);
}
.portfolio-link-row {
display: grid;
grid-template-columns: max-content minmax(0, 1fr);
gap: 1ch;
align-items: baseline;
}
.portfolio-link-url {
color: color-mix(in srgb, var(--color-theme-meta) 72%, transparent);
font-size: calc(var(--size-theme-font) * 0.9);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.portfolio-detail-content > *:first-child {
margin-top: 0;
}
@media (max-width: $phone-max-width) {
.portfolio-list {
grid-template-columns: 1fr;
}
.portfolio-actions {
gap: 0 1.25ch;
}
.portfolio-link-row {
grid-template-columns: 1fr;
gap: 0;
}
.portfolio-link-url {
display: block;
}
}
+2 -1
View File
@@ -10,9 +10,10 @@
@use "moment"; @use "moment";
@use "pagination"; @use "pagination";
@use "post"; @use "post";
@use "portfolio";
@use "search"; @use "search";
@use "theme"; @use "theme";
@use "toc"; @use "toc";
@use "sns"; @use "sns";
@use "typed-text"; @use "typed-text";
@use "friends"; @use "friends";
+83
View File
@@ -0,0 +1,83 @@
<!DOCTYPE html>
<html
xmlns:th="https://www.thymeleaf.org"
th:replace="~{modules/layout :: html(title = |${project.title} - #{page.portfolio.title} - ${site.title}|, header = null, content = ~{::content}, footer = null)}"
>
<th:block th:fragment="content"
th:with="hasCover=${project.cover != null and !project.cover.isEmpty()},
hasRepoUrl=${project.repoUrl != null and !project.repoUrl.isEmpty()},
hasDemoUrl=${project.demoUrl != null and !project.demoUrl.isEmpty()},
hasDocsUrl=${project.docsUrl != null and !project.docsUrl.isEmpty()},
hasSummary=${project.summary != null and !project.summary.isEmpty()},
hasContent=${project.content != null and !project.content.isEmpty()},
hasRenderedContent=${projectContentHtml != null and !projectContentHtml.isEmpty()},
platformLabel=${platformLabels != null and project.platform != null ? (platformLabels[project.platform] ?: project.platform) : project.platform},
typeLabel=${typeLabels != null and project.type != null ? (typeLabels[project.type] ?: project.type) : project.type}">
<article class="post portfolio-detail-post">
<header>
<h1 class="post-title" th:text="${project.title}">Project Title</h1>
<div class="post-meta portfolio-meta"
th:if="${project.featured == true
or !#strings.isEmpty(platformLabel)
or !#strings.isEmpty(typeLabel)
or (project.techStacks != null and !project.techStacks.isEmpty())
or (project.tags != null and !project.tags.isEmpty())}">
<span class="post-meta portfolio-meta-line"
th:if="${project.featured == true
or !#strings.isEmpty(platformLabel)
or !#strings.isEmpty(typeLabel)
or (project.tags != null and !project.tags.isEmpty())}">
<span class="portfolio-meta-group" th:if="${project.featured == true or !#strings.isEmpty(platformLabel) or !#strings.isEmpty(typeLabel)}">
<span th:if="${project.featured == true}" th:text="#{page.portfolio.featured}">Featured</span>
<span class="portfolio-card-label" th:if="${!#strings.isEmpty(platformLabel)}" th:text="|[${platformLabel}]|">[GitHub]</span>
<span class="portfolio-card-label" th:if="${!#strings.isEmpty(typeLabel)}" th:text="|[${typeLabel}]|">[Open Source]</span>
</span><span class="portfolio-meta-group post-tags portfolio-tags" th:if="${project.tags != null and !project.tags.isEmpty()}"><span class="post-tag portfolio-tag" th:each="tag : ${project.tags}" th:text="|#${tag}|">#tag</span></span>
</span>
<span class="portfolio-techs" th:if="${project.techStacks != null and !project.techStacks.isEmpty()}">
<span class="portfolio-term" th:each="tech : ${project.techStacks}" th:text="|[${tech}]|">[Rust]</span>
</span>
</div>
</header>
<section class="post-content portfolio-detail">
<img th:if="${hasCover == true}" th:src="${project.cover}" th:alt="${project.title}" class="portfolio-detail-cover" />
<blockquote class="portfolio-detail-summary" th:if="${hasSummary == true}" th:text="${project.summary}">
Summary text here.
</blockquote>
<section class="portfolio-detail-section portfolio-detail-links" th:if="${hasRepoUrl == true or hasDemoUrl == true or hasDocsUrl == true}">
<h2 th:text="#{page.portfolio.links}">Links</h2>
<ul class="portfolio-link-list">
<li class="portfolio-link-row" th:if="${hasRepoUrl == true}">
<a class="portfolio-action button inline" th:href="${project.repoUrl}" target="_blank" rel="noopener noreferrer"
th:text="#{page.portfolio.repository}">Repository</a>
<span class="portfolio-link-url" th:text="${project.repoUrl}">https://github.com/example/repo</span>
</li>
<li class="portfolio-link-row" th:if="${hasDemoUrl == true}">
<a class="portfolio-action button inline" th:href="${project.demoUrl}" target="_blank" rel="noopener noreferrer"
th:text="#{page.portfolio.demo}">Demo</a>
<span class="portfolio-link-url" th:text="${project.demoUrl}">https://example.com</span>
</li>
<li class="portfolio-link-row" th:if="${hasDocsUrl == true}">
<a class="portfolio-action button inline" th:href="${project.docsUrl}" target="_blank" rel="noopener noreferrer"
th:text="#{page.portfolio.docs}">Docs</a>
<span class="portfolio-link-url" th:text="${project.docsUrl}">https://docs.example.com</span>
</li>
</ul>
</section>
<section class="portfolio-detail-section" th:if="${hasRenderedContent == true}">
<h2 th:text="#{page.portfolio.content}">Content</h2>
<div class="portfolio-detail-content" th:utext="${projectContentHtml}"></div>
</section>
<div class="portfolio-detail-nav">
<a data-pjax class="button inline portfolio-detail-back" th:href="@{/portfolio}">
<span th:text="'< ' + #{page.portfolio.back}">&lt; portfolio</span>
</a>
</div>
</section>
</article>
</th:block>
</html>
+90
View File
@@ -0,0 +1,90 @@
<!DOCTYPE html>
<html
xmlns:th="https://www.thymeleaf.org"
th:replace="~{modules/layout :: html(title = |#{page.portfolio.title} - ${site.title}|, header = null, content = ~{::content}, footer = null)}"
>
<th:block th:fragment="content">
<article class="portfolio-page">
<header>
<h1 class="post-title" th:text="#{page.portfolio.title}">Portfolio</h1>
</header>
<section class="posts portfolio-list" th:if="${projects.items != null and !projects.items.isEmpty()}">
<article class="post on-list portfolio-item" th:each="project, iterStat : ${projects.items}"
th:with="platformLabel=${platformLabels != null and project.platform != null ? (platformLabels[project.platform] ?: project.platform) : project.platform},
typeLabel=${typeLabels != null and project.type != null ? (typeLabels[project.type] ?: project.type) : project.type}">
<a data-pjax class="portfolio-card-cover" th:if="${!#strings.isEmpty(project.cover)}"
th:href="@{/portfolio/{slug}(slug=${project.slug})}">
<img th:src="${project.cover}" th:alt="${project.title}" />
</a>
<header>
<h2 class="post-title">
<a data-pjax th:href="@{/portfolio/{slug}(slug=${project.slug})}" th:text="${project.title}">Project Name</a>
</h2>
<div class="post-meta portfolio-meta"
th:if="${project.featured == true
or !#strings.isEmpty(platformLabel)
or !#strings.isEmpty(typeLabel)
or (project.tags != null and !project.tags.isEmpty())
or (project.techStacks != null and !project.techStacks.isEmpty())}">
<span class="portfolio-meta-line"
th:if="${project.featured == true
or !#strings.isEmpty(platformLabel)
or !#strings.isEmpty(typeLabel)
or (project.tags != null and !project.tags.isEmpty())}">
<span class="portfolio-meta-group" th:if="${project.featured == true or !#strings.isEmpty(platformLabel) or !#strings.isEmpty(typeLabel)}">
<span th:if="${project.featured == true}" th:text="#{page.portfolio.featured}">Featured</span>
<span class="portfolio-card-label" th:if="${!#strings.isEmpty(platformLabel)}" th:text="|[${platformLabel}]|">[GitHub]</span>
<span class="portfolio-card-label" th:if="${!#strings.isEmpty(typeLabel)}" th:text="|[${typeLabel}]|">[Open Source]</span>
</span>
<span class="portfolio-meta-group post-tags portfolio-tags" th:if="${project.tags != null and !project.tags.isEmpty()}">
<span class="post-tag portfolio-tag" th:each="tag : ${project.tags}" th:text="|#${tag}|">#tag</span>
</span>
</span>
<span class="portfolio-techs" th:if="${project.techStacks != null and !project.techStacks.isEmpty()}">
<span class="portfolio-term" th:each="tech : ${project.techStacks}" th:text="|[${tech}]|">[Rust]</span>
</span>
</div>
</header>
<div class="post-excerpt" th:if="${!#strings.isEmpty(project.summary)}">
<span th:text="${project.summary}">A brief summary of the project.</span>
</div>
<div class="portfolio-actions">
<a data-pjax class="portfolio-action button inline" th:href="@{/portfolio/{slug}(slug=${project.slug})}"
th:text="#{page.portfolio.detail}">Detail</a>
<a class="portfolio-action button inline" th:if="${!#strings.isEmpty(project.repoUrl)}"
th:href="${project.repoUrl}" target="_blank" rel="noopener noreferrer"
th:text="#{page.portfolio.repository}">Repository</a>
<a class="portfolio-action button inline" th:if="${!#strings.isEmpty(project.demoUrl)}"
th:href="${project.demoUrl}" target="_blank" rel="noopener noreferrer"
th:text="#{page.portfolio.demo}">Demo</a>
</div>
</article>
</section>
<section class="post-content">
<p th:if="${projects.items == null or projects.items.isEmpty()}" class="portfolio-empty" th:text="#{page.portfolio.empty}">
No projects found.
</p>
</section>
<nav class="pagination" th:if="${projects.hasPrevious() or projects.hasNext()}">
<div class="pagination-buttons">
<span th:if="${projects.hasPrevious()}">
<a data-pjax th:href="@{/portfolio(page=${projects.page - 1})}" th:classappend="${projects.page == 1} ? 'first-page' : ''" class="button prev inline">
<span class="button-text" th:text="'< ' + #{page.pagination.prev}">&lt;&nbsp;Prev</span>
</a>
</span>
<span th:if="${projects.hasNext()}">
<a data-pjax th:href="@{/portfolio(page=${projects.page + 1})}" class="button inline next">
<span class="button-text" th:text="#{page.pagination.next} + ' >'">Next&nbsp;&gt;</span>
</a>
</span>
</div>
</nav>
</article>
</th:block>
</html>