mirror of https://gitlab.com/mayx/mayx.gitlab.io
parent
446c34abec
commit
c2351bc269
|
@ -11,7 +11,9 @@
|
|||
<link rel="alternate" type="application/rss+xml" title="{{ site.title }}(RSS)" href="{{ "/rss.xml" | absolute_url }}" />
|
||||
<link rel="alternate" type="application/json" title="{{ site.title }}(JSON Feed)" href="{{ "/feed.json" | absolute_url }}" />
|
||||
<link rel="stylesheet" href="/assets/css/style.css?v={{ site.time | date: "%s" }}" />
|
||||
<!--[if !IE]> -->
|
||||
<link rel="stylesheet" href="/Live2dHistoire/live2d/css/live2d.css" />
|
||||
<!-- <![endif]-->
|
||||
<link rel="webmention" href="https://webmention.io/mabbs.github.io/webmention" />
|
||||
<link rel="pingback" href="https://webmention.io/mabbs.github.io/xmlrpc" />
|
||||
<link rel="preconnect" href="https://summary.mayx.eu.org" crossorigin="anonymous" />
|
||||
|
@ -22,6 +24,7 @@
|
|||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<script>
|
||||
var lastUpdated = new Date("{{ site.time | date_to_rfc822 }}");
|
||||
|
|
20
search.html
20
search.html
|
@ -9,15 +9,25 @@ title: 搜索
|
|||
<p><center><input name="q" type="text" id="search-input" placeholder="Search blog posts.." /> <!--[if !IE]> --><img src="/images/loading.svg" alt="Loading..." id="search-loading" style="width:22px;vertical-align: bottom" /><!-- <![endif]--> <input type="submit" value="谷歌搜索" style="margin-left: 5px;" /></center></p>
|
||||
</form>
|
||||
<ul id="results-container"></ul>
|
||||
<!--[if !IE]> -->
|
||||
<script src="/assets/js/simple-jekyll-search.min.js"></script>
|
||||
<script>
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const mykeyword = urlParams.get('keyword')?.trim();
|
||||
const sbox = document.getElementById('search-input');
|
||||
function getQueryVariable(variable){
|
||||
var query = window.location.search.substring(1);
|
||||
var vars = query.split("&");
|
||||
for (var i=0;i<vars.length;i++) {
|
||||
var pair = vars[i].split("=");
|
||||
if(pair[0] == variable){return pair[1];}
|
||||
}
|
||||
return('');
|
||||
}
|
||||
var mykeyword = decodeURI(getQueryVariable("keyword"));
|
||||
var sbox = document.getElementById('search-input');
|
||||
if (mykeyword) {
|
||||
sbox.value = mykeyword;
|
||||
}
|
||||
</script>
|
||||
<!--[if !IE]> -->
|
||||
<script src="/assets/js/simple-jekyll-search.min.js"></script>
|
||||
<script>
|
||||
getSearchJSON(function(json){
|
||||
var sjs = SimpleJekyllSearch({
|
||||
searchInput: sbox,
|
||||
|
|
Loading…
Reference in New Issue