404: move inline scripts to vite

This commit is contained in:
Miao Wang 2024-04-09 00:54:05 +08:00
parent 95c919773e
commit 05d5d6ba63
2 changed files with 15 additions and 15 deletions

View File

@ -47,21 +47,6 @@ jsEntry: notfound
</div><!--/container -->
</div><!--/mirrors -->
{% 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", 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", tag + "Mirror Request for new mirror " +
location.pathname.split('/')[1]);
mrLink.href = mrURL.href;
})();
</script>
</body>
</html>
<!--

View File

@ -1,2 +1,17 @@
import "./default"
import "../styles/notfound.scss"
import {
issue_tag as IssueTag
} from 'virtual:jekyll-config'
const tag = `[${IssueTag}]`;
const bugLink = document.getElementById("new_issue_bug");
const bugURL = new URL(bugLink.href);
bugURL.searchParams.append("title", tag + "404 at " + location.pathname);
bugLink.href = bugURL.href;
const mrLink = document.getElementById("new_issue_mr");
const mrURL = new URL(mrLink.href);
mrURL.searchParams.append("title", tag + "Mirror Request for new mirror " +
location.pathname.split('/')[1]);
mrLink.href = mrURL.href;