添加友链页面描述信息来源

This commit is contained in:
fishcpy 2025-03-11 23:49:10 +08:00
parent 6e570e04ac
commit 9270dfe326
3 changed files with 28 additions and 2 deletions

View File

@ -951,6 +951,26 @@ spec:
label: 友链页面-RSS订阅地址 label: 友链页面-RSS订阅地址
placeholder: '请输入RSS订阅地址' placeholder: '请输入RSS订阅地址'
help: '用于交换友链时添加朋友圈的RSS订阅地址。' help: '用于交换友链时添加朋友圈的RSS订阅地址。'
- $formkit: radio
name: use_user_bio
label: 友链页面-描述来源
value: true
options:
- value: true
label: 使用用户信息
- value: false
label: 单独提供
- $formkit: text
name: links_descriptive
label: 友链页面-自定义描述
placeholder: '请输入描述'
help: '用于交换友链时添加的描述。'
if: $get(use_user_bio).value == false
- $formkit: text
name: links_descriptive
label: 友链页面-描述(仅在选择单独提供时可用)
placeholder: '请输入描述'
help: '用于交换友链时添加的描述。'
- $formkit: code - $formkit: code
name: links_info name: links_info
label: "友链页面-补充信息" label: "友链页面-补充信息"

View File

@ -33,13 +33,19 @@
</th:block> </th:block>
<hr th:if="${theme.config.page_config.show_exchange_info || !#strings.isEmpty(theme.config.page_config.links_info)}"/> <hr th:if="${theme.config.page_config.show_exchange_info || !#strings.isEmpty(theme.config.page_config.links_info)}"/>
<th:block th:if="${theme.config.page_config.show_exchange_info}" <th:block th:if="${theme.config.page_config.show_exchange_info}"
th:with="bloggerAvatar= ${#strings.defaultString(theme.config.page_config.links_blogger_avatar, contributor.avatar)}"> th:with="bloggerAvatar= ${#strings.defaultString(theme.config.page_config.links_blogger_avatar, contributor.avatar)},
descriptive= ${#strings.defaultString(theme.config.page_config.links_descriptive, '')}">
<p style="margin-bottom: 4px">申请友链的方法:</p> <p style="margin-bottom: 4px">申请友链的方法:</p>
<ul> <ul>
<li>名称:[[${site.title}]]</li> <li>名称:[[${site.title}]]</li>
<li>地址:<a th:href="${site.url}" target="_blank" th:text="${site.url}"></a></li> <li>地址:<a th:href="${site.url}" target="_blank" th:text="${site.url}"></a></li>
<li>图标:<a th:href="${bloggerAvatar}" target="_blank" th:text="${bloggerAvatar}"></a></li> <li>图标:<a th:href="${bloggerAvatar}" target="_blank" th:text="${bloggerAvatar}"></a></li>
<li>描述:[[${contributor.bio}]]</li> <li th:if="${theme.config.page_config.use_user_bio}">
描述:<span th:text="${contributor.bio}"></span>
</li>
<li th:unless="${theme.config.page_config.use_user_bio}" th:if="${!#strings.isEmpty(descriptive)}">
描述:<span th:text="${descriptive}"></span>
</li>
<li th:if="${!#strings.isEmpty(theme.config.page_config.links_rss_address)}">订阅:<a th:href="${theme.config.page_config.links_rss_address}" target="_blank" th:text="${theme.config.page_config.links_rss_address}"></a></li> <li th:if="${!#strings.isEmpty(theme.config.page_config.links_rss_address)}">订阅:<a th:href="${theme.config.page_config.links_rss_address}" target="_blank" th:text="${theme.config.page_config.links_rss_address}"></a></li>
</ul> </ul>
</th:block> </th:block>