添加500页面 (#412)

This commit is contained in:
Roozen 2023-08-12 11:10:04 +08:00 committed by GitHub
parent b588ab8088
commit dbe6f2aaab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 70 additions and 4 deletions

View File

@ -2660,17 +2660,28 @@ spec:
name: error_404
label: 404 页面
value:
subtitle:
background:
subtitle: 请尝试站内搜索寻找文章
background: /themes/theme-hao/assets/images/404s.gif
children:
- $formkit: text
name: subtitle
label: 标题
- $formkit: attachment
name: background
label: 背景
- $formkit: group
name: error_500
label: 500 页面
value:
subtitle: 服务器内部出现错误,请查看日志
background: /themes/theme-hao/assets/images/404s.gif
children:
- $formkit: text
name: subtitle
label: 标题
value: 请尝试站内搜索寻找文章
- $formkit: attachment
name: background
label: 背景
value: /themes/theme-hao/assets/images/404s.gif
- $formkit: radio
name: bubbleEnable
label: 页面卡片顶部气泡升起效果

55
templates/error/500.html Normal file
View File

@ -0,0 +1,55 @@
<!DOCTYPE html>
<html lang="en" th:replace="~{modules/layouts/layout :: layout(content = ~{::content}, htmlType = '500')}"
xmlns:th="http://www.thymeleaf.org">
<th:block th:fragment="content">
<div class="page" id="body-wrap">
<div class="errors">
<!-- 头部导航栏 -->
<div>
<header class="not-top-img" id="page-header">
<nav th:replace="~{modules/nav :: nav(title = null)}"></nav>
</header>
</div>
<div id="error-wrap">
<div class="error-content">
<div class="error-img" th:style="'background-image: url('+${theme.config.other.error_500.background}+')'">
</div>
<div class="error-info">
<h1 class="error_title">500</h1>
<div class="error_subtitle">[[${theme.config.other.error_500.subtitle}]]</div>
<a class="button--animated" href="/"
data-pjax-state=""><i class="fas fa-rocket"></i>回到主页</a>
</div>
</div>
</div>
<!-- 默认设置前 6 篇文章 -->
<div class="aside-list">
<div class="aside-list-group"
th:with='topGroupPosts = ${postFinder.list(1,6)},
postRandomImg=${#strings.contains(theme.config.layout.postRandomImg,"?") ? theme.config.layout.postRandomImg : theme.config.layout.postRandomImg+"?"}'>
<div th:each="post : ${topGroupPosts}" class="aside-list-item"><a class="thumbnail"
th:href="@{${post.status.permalink}}"
th:title="${post.spec.title}"><img
loading="lazy"
th:src='${#strings.isEmpty(post.spec.cover) ? postRandomImg+","+post.spec.title : post.spec.cover}'
th:alt="${post.spec.title}"></a>
<div class="content"><a class="title" th:href="@{${post.status.permalink}}"
th:title="${post.spec.title}"
data-pjax-state="">[[${post.spec.title}]]</a>
<!-- <time datetime="2023-06-08T04:08:22.000Z" title="创建 2023-06-08 12:08:22">2023-06-08</time> -->
</div>
</div>
</div>
</div>
</div>
<!-- 底部 -->
<footer th:replace="~{modules/footer :: footer}"></footer>
</div>
</th:block>
</html>