Merge remote-tracking branch 'upstream/main' into chore/bump-dependencies

This commit is contained in:
Ryan Wang
2024-11-16 11:10:48 +08:00
9 changed files with 63 additions and 20 deletions

3
.gitignore vendored
View File

@@ -23,4 +23,5 @@ node_modules
.gradle
build
dist
templates/assets/dist
dist

View File

@@ -110,6 +110,19 @@ spec:
value: github
- label: Tailwind CSS Typography
value: tailwind
- $formkit: select
name: title_position
label: 标题位置
value: "content"
options:
- value: "content"
label: "正文中"
- value: "cover"
label: "封面中"
- $formkit: text
name: cover_height
label: 封面图高度
value: "24rem"
- $formkit: checkbox
name: show_upvote_button
label: 显示点赞按钮

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -8,7 +8,7 @@
<span class="text-sm opacity-80 dark:text-slate-50" th:text="${category.spec.displayName}"> </span>
<span
class="rounded bg-gray-100 px-1 py-0.5 text-xs tabular-nums opacity-70 group-hover:bg-white dark:bg-slate-600 dark:text-slate-50 dark:group-hover:bg-slate-500"
th:text="${category.status.visiblePostCount}"
th:text="${category.status.visiblePostCount ?: 0}"
>
</span>
</a>

View File

@@ -12,7 +12,7 @@
th:classappend="(${tag} and ${tag.metadata.name == tagItem.metadata.name}) or (not ${tag} and ${tagStat.index == 0}) ? '!border-indigo-400 dark:!border-indigo-200' : ''"
>
<th:block th:text="|#${tagItem.spec.displayName}|" />
<sup th:text="${tagItem.status.visiblePostCount}"></sup>
<sup th:text="${tagItem.status.visiblePostCount ?: 0}"></sup>
</a>
</div>
</div>

View File

@@ -22,7 +22,7 @@
class="inline-flex items-center gap-x-1.5 rounded-full border border-gray-200 bg-white px-2.5 py-1 text-xs font-medium text-gray-800 shadow-sm hover:border-indigo-400 dark:border-slate-800 dark:bg-slate-700 dark:text-slate-200 dark:hover:border-indigo-200"
>
<th:block th:text="|#${tag.spec.displayName}|" />
<sup th:text="${tag.status.visiblePostCount}"></sup>
<sup th:text="${tag.status.visiblePostCount ?: 0}"></sup>
</a>
</div>
</div>

View File

@@ -7,9 +7,20 @@
<link rel="stylesheet" th:href="@{/assets/styles/github-markdown.css?v={version}(version=${theme.spec.version})}" />
</th:block>
<th:block th:fragment="hero">
<th:block
th:replace="~{modules/hero :: hero(isHome = false, cover = ${singlePage.spec.cover}, title = ${singlePage.spec.title})}"
/>
<section th:unless="${#strings.isEmpty(singlePage.spec.cover)}">
<div class="relative flex items-center" th:styleappend="|height:${theme.config.post.cover_height ?: '24rem'}|">
<div
class="before:z-1 relative size-full bg-cover bg-center bg-no-repeat before:absolute before:inset-0 before:bg-black/40"
th:style="|background-image: url('${singlePage.spec.cover}')|"
></div>
<header
class="pattern-header-text absolute top-1/3 mx-auto flex w-full flex-col items-center justify-center gap-3"
th:if="${theme.config.post.title_position == 'cover'}"
>
<h1 class="text-center text-2xl text-white sm:text-5xl" th:text="${singlePage.spec.title}"></h1>
</header>
</div>
</section>
</th:block>
<th:block th:fragment="content">
<div class="rounded-xl bg-white p-4 dark:bg-slate-800">
@@ -81,7 +92,12 @@
</div>
</div>
</div>
<h1 class="my-3 text-2xl font-medium dark:text-slate-50" th:text="${singlePage.spec.title}"></h1>
<h1
th:if="${#strings.isEmpty(singlePage.spec.cover)} or ${theme.config.post.title_position == 'content'}"
class="my-3 text-3xl font-medium dark:text-slate-50"
th:text="${singlePage.spec.title}"
></h1>
<article
class="!max-w-none break-words"
th:classappend="${theme.config.post.content_style == 'github' ? 'markdown-body' : 'tailwind-typography'}"

View File

@@ -4,12 +4,27 @@
th:replace="~{modules/layout :: html(title = ${post.spec.title} + ' - ' + ${site.title}, hero = ~{::hero}, content = ~{::content}, head = ~{::head}, footer = ~{::footer}, sidebar = ~{::sidebar}, contentClass = ${theme.config.layout.content_header} and ${not #strings.isEmpty(post.spec.cover)} ? '!-mt-20' : '')}"
>
<th:block th:fragment="head">
<link rel="stylesheet" th:href="@{/assets/styles/github-markdown.css?v={version}(version=${theme.spec.version})}" />
<link
th:if="${theme.config.post.content_style == 'github'}"
rel="stylesheet"
th:href="@{/assets/styles/github-markdown.css?v={version}(version=${theme.spec.version})}"
/>
</th:block>
<th:block th:fragment="hero">
<th:block
th:replace="~{modules/hero :: hero(isHome = false, cover = ${post.spec.cover}, title = ${post.spec.title})}"
/>
<section th:unless="${#strings.isEmpty(post.spec.cover)}">
<div class="relative flex items-center" th:styleappend="|height:${theme.config.post.cover_height ?: '24rem'}|">
<div
class="before:z-1 relative size-full bg-cover bg-center bg-no-repeat before:absolute before:inset-0 before:bg-black/40"
th:style="|background-image: url('${post.spec.cover}')|"
></div>
<header
class="pattern-header-text absolute top-1/3 mx-auto flex w-full flex-col items-center justify-center gap-3"
th:if="${theme.config.post.title_position == 'cover'}"
>
<h1 class="text-center text-2xl text-white sm:text-5xl" th:text="${post.spec.title}"></h1>
</header>
</div>
</section>
</th:block>
<th:block th:fragment="footer">
<script>
@@ -128,8 +143,12 @@
</div>
</div>
</div>
<h1 class="my-3 text-2xl font-medium dark:text-slate-50" th:text="${post.spec.title}"></h1>
<div class="flex gap-2">
<h1
th:if="${#strings.isEmpty(post.spec.cover)} or ${theme.config.post.title_position == 'content'}"
class="mt-3 text-3xl font-medium dark:text-slate-50"
th:text="${post.spec.title}"
></h1>
<div class="mt-3 flex gap-2">
<a
th:each="tag : ${post.tags}"
th:href="@{${tag.status.permalink}}"