Make 404 page configurable

This commit is contained in:
Jiajie Chen 2020-03-23 22:34:37 +08:00
parent 4d11f03d38
commit 40a8945c80
2 changed files with 11 additions and 4 deletions

View File

@ -11,12 +11,16 @@ permalink: /404.html
<div class="container">
<div class="row">
<div class="not-found">
<div class="not-found-bg"></div>
{% if site.meow_404 %}
<div class="not-found-bg"></div>
{% endif %}
<div class="not-found-hint">
<div class="not-found-code">
404 NOT FOUND
</div>
<span class="thuhidden">呜喵,金枪鱼</span>被吃掉了
{% if site.meow_404 %}
<span class="thuhidden">呜喵,金枪鱼</span>被吃掉了
{% endif %}
</div>
<div class="not-found-text thuhidden">
如果您认为这一定是出了什么问题,或者正在寻找暂未包含的镜像,欢迎您前往
@ -43,14 +47,15 @@ permalink: /404.html
{% include footer.html %}
<script type="application/javascript">
(function(){
var tag = "[" + "{{ site.issue_tag }}" + "]";
var bugLink = document.getElementById("new_issue_bug");
var bugURL = new URL(bugLink.href);
bugURL.searchParams.append("title", "404 at " + location.pathname);
bugURL.searchParams.append("title", tag + "404 at " + location.pathname);
bugLink.href = bugURL.href;
var mrLink = document.getElementById("new_issue_mr");
var mrURL = new URL(mrLink.href);
mrURL.searchParams.append("title", "Mirror Request for new mirror " +
mrURL.searchParams.append("title", tag + "Mirror Request for new mirror " +
location.pathname.split('/')[1]);
mrLink.href = mrURL.href;
})();

View File

@ -14,6 +14,8 @@ brand: Tsinghua Open Source Mirror
operator: 清华大学信息化技术中心
# operator: 北外信息技术中心
logo: true
meow_404: true
issue_tag: tuna
baseurl: "" # the subpath of your site, e.g. /blog
permalink: "/:categories/:title/"
url: "https://mirrors.tuna.tsinghua.edu.cn"