mirror of
https://ghfast.top/https://github.com/zsjy/halo-theme-dream2.0-plus.git
synced 2025-03-15 13:09:40 +08:00
添加友链页面描述信息来源
This commit is contained in:
parent
effa4a5ae8
commit
4617af64f0
@ -953,9 +953,9 @@ spec:
|
||||
help: '用于交换友链时添加朋友圈的RSS订阅地址。'
|
||||
- $formkit: text
|
||||
name: links_descriptive
|
||||
label: 友链页面-自定义描述(留空使用用户信息)
|
||||
label: 友链页面-自定义描述
|
||||
placeholder: '请输入描述'
|
||||
help: '用于交换友链时添加的描述。'
|
||||
help: '用于交换友链时添加的描述,(留空使用用户信息)。'
|
||||
- $formkit: code
|
||||
name: links_info
|
||||
label: "友链页面-补充信息"
|
||||
|
@ -135,24 +135,22 @@
|
||||
<p th:if="${error.status >= 500 && error.status < 600}">围观群众太过热情,服务器繁忙,请稍后访问。</p>
|
||||
<p th:if="${error.status >= 400 && error.status < 500}">抱歉,您请求的页面不存在。</p>
|
||||
<p th:if="${error.status >= 400 && error.status < 500}">可能是输入的网址有误,或者该页面已被移动或删除。</p>
|
||||
<a th:if="${error.status >= 400 && error.status < 500}" href="/" class="back-link">手动返回首页</a>
|
||||
<div class="loading-bar">
|
||||
<a th:if="${error.status >= 400 && error.status < 500}" href="/" class="back-link">手动返回首页</a></p>
|
||||
<div th:if="${error.status >= 400 && error.status < 500}" class="loading-bar">
|
||||
<div class="loading-bar-inner"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<script th:inline="javascript">
|
||||
const websites = [
|
||||
// 在此处添加更多友链地址
|
||||
"/",
|
||||
"https://example.com"
|
||||
"/"
|
||||
];
|
||||
|
||||
function redirectToRandomWebsite() {
|
||||
// 获取错误状态码(通过解析标题文本)
|
||||
const errorCode = parseInt(document.querySelector('h1').textContent.split(' ')[0]);
|
||||
|
||||
const errorCode = [[${error.status}]];
|
||||
|
||||
// 仅当 400 <= 错误码 < 500 时执行跳转
|
||||
if (errorCode >= 400 && errorCode < 500) {
|
||||
const randomIndex = Math.floor(Math.random() * websites.length);
|
||||
|
@ -34,18 +34,13 @@
|
||||
<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:with="bloggerAvatar= ${#strings.defaultString(theme.config.page_config.links_blogger_avatar, contributor.avatar)},
|
||||
descriptive= ${#strings.defaultString(theme.config.page_config.links_descriptive, '')}">
|
||||
descriptive= ${#strings.defaultString(theme.config.page_config.links_descriptive, contributor.bio)}">
|
||||
<p style="margin-bottom: 4px">申请友链的方法:</p>
|
||||
<ul>
|
||||
<li>名称:[[${site.title}]]</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 th:with="descriptive = ${#strings.defaultString(theme.config.page_config.links_descriptive, '')}">
|
||||
<span th:if="${!#strings.isEmpty(descriptive)}">描述:</span>
|
||||
<span th:if="${!#strings.isEmpty(descriptive)}" th:text="${descriptive}"></span>
|
||||
<span th:if="${#strings.isEmpty(descriptive)}">描述:</span>
|
||||
<span th:if="${#strings.isEmpty(descriptive)}" th:text="${contributor.bio}"></span>
|
||||
</li>
|
||||
<li>描述:[[${descriptive}]]</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>
|
||||
</th:block>
|
||||
|
Loading…
x
Reference in New Issue
Block a user