feat: make tags display configurable

This commit is contained in:
Erzbir
2025-11-18 14:04:26 +08:00
parent cc6445a0d9
commit 1c5320e584
5 changed files with 15 additions and 9 deletions
+2 -4
View File
@@ -25,10 +25,8 @@
Publish
Time
</time>
<a data-pjax th:href="@{${post.status.permalink}}"><span class="post-list-title"
th:text="${post.spec.title}">Post Title</span></a>
<th:block th:replace="~{modules/tag-list(post = ${post})}"
th:if="${theme.config.archives_page.show_tags}"/></div>
<a data-pjax th:href="@{${post.status.permalink}}"><span class="post-list-title" th:text="${post.spec.title}">Post Title</span>
</a><th:block th:replace="~{modules/tag-list(post = ${post}, show = ${theme.config.archives_page.show_tags})}"/></div></span>
</li>
</th:block>
</ul>
+1 -1
View File
@@ -32,7 +32,7 @@
theme.config.style.custom_time_style : theme.config.style.time_style}__')}">Publish Time</time>
<span class="post-author"
th:with="contributor = ${post.contributors[0]}"
th:text="${contributor.displayName}">Author</span><th:block th:replace="~{modules/tag-list(post = ${post})}"/>
th:text="${contributor.displayName}">Author</span><th:block th:replace="~{modules/tag-list(post = ${post}, show = ${theme.config.index_page.show_tags})}"/>
</div>
</header>
<div class="post-excerpt">
+2 -2
View File
@@ -1,5 +1,5 @@
<th:block th:fragment="tag-list(post)">
<span class="post-tags" th:if="${not post.tags.isEmpty()}"><span class="post-tag" th:each="tag : ${post.tags}"><a data-pjax
<th:block th:fragment="tag-list(post, show)">
<span class="post-tags" th:if="${show and not post.tags.isEmpty()}"><span class="post-tag" th:each="tag : ${post.tags}"><a data-pjax
th:href="@{${tag.status.permalink}}"
th:title="${tag.spec.displayName}"
th:text="'#'+${tag.spec.displayName}">#Tag</a>
+1 -1
View File
@@ -12,7 +12,7 @@
th:text="${#dates.format(post.spec.publishTime, '__${theme.config.style.time_style == 'custom' ?
theme.config.style.custom_time_style : theme.config.style.time_style}__')}">Publish Time
</time>
<span class="post-author" th:text="${post.owner.displayName}">Author</span><th:block th:replace="~{modules/tag-list(post = ${post})}"/>
<span class="post-author" th:text="${post.owner.displayName}">Author</span><th:block th:replace="~{modules/tag-list(post = ${post}, show = ${theme.config.post_page.show_tags})}"/>
</div>
</header>
<section class="post-content">