2018-10-30 17:09:13 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
{% include head.html %}
|
2018-11-13 08:54:50 +00:00
|
|
|
<body id="bdy">
|
2018-11-02 15:00:59 +00:00
|
|
|
<header class="header">
|
|
|
|
{% include header.html %}
|
|
|
|
</header>
|
|
|
|
<main class="container">
|
|
|
|
{{ content }}
|
|
|
|
</main>
|
|
|
|
{% include footer.html %}
|
2018-11-08 08:21:27 +00:00
|
|
|
<script src="https://cdn.rawgit.com/christian-fei/Simple-Jekyll-Search/master/dest/simple-jekyll-search.min.js"></script>
|
|
|
|
<script>
|
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
|
|
var searchBar = document.getElementById('search-bar');
|
|
|
|
var results = document.getElementById('search-results');
|
|
|
|
|
|
|
|
var sjs = SimpleJekyllSearch({
|
|
|
|
searchInput: searchBar,
|
|
|
|
resultsContainer: results,
|
|
|
|
json: '/search.json',
|
|
|
|
searchResultTemplate:
|
2018-11-11 13:22:26 +00:00
|
|
|
'<li><a href="{url}"><h3>{title}</h3><h4>{category}</h4></a></li>',
|
2018-11-08 08:21:27 +00:00
|
|
|
success: function(sr) {
|
|
|
|
results.setAttribute("class", sr.length <= 1 ? "" : "show");
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
searchBar.addEventListener('keypress', function () {
|
|
|
|
sjs.search();
|
|
|
|
});
|
|
|
|
});
|
2018-11-13 08:54:50 +00:00
|
|
|
|
|
|
|
var bdy = document.getElementById("bdy");
|
|
|
|
document.addEventListener("keypress", function(event){
|
2018-11-15 16:19:19 +00:00
|
|
|
if(event.key == "w" || event.key == "k"){
|
2018-11-13 08:54:50 +00:00
|
|
|
window.scrollTo (0,0);
|
2018-11-15 16:19:19 +00:00
|
|
|
}else if(event.key == "~"){
|
|
|
|
location.href = "{{ site.baseurl }}/";
|
|
|
|
}else if(event.key == "a" || event.key == "h"){
|
|
|
|
var previous = "{{ site.baseurl }}/{{ page.previous-page }}";
|
|
|
|
if(previous){
|
|
|
|
location.href = previous;
|
|
|
|
}
|
|
|
|
}else if(event.key == "d" || event.key == "l"){
|
|
|
|
var next = "{{ site.baseurl }}/{{ page.next-page }}";
|
|
|
|
if(next){
|
|
|
|
location.href = next;
|
|
|
|
}
|
|
|
|
}else if(event.key == "s" || event.key == "j"){
|
|
|
|
var topic;
|
|
|
|
switch("{{ page.category-page }}"){
|
|
|
|
case "basic":
|
|
|
|
topic = "{{ site.baseurl }}/pages/topic/cmd/basic.html";
|
|
|
|
case "intermediate":
|
|
|
|
topic = "{{ site.baseurl }}/pages/topic/cmd/intermediate.html";
|
|
|
|
case "advanced":
|
|
|
|
topic = "{{ site.baseurl }}/pages/topic/cmd/advanced.html";
|
|
|
|
case "fs":
|
|
|
|
topic = "{{ site.baseurl }}/pages/topic/fs.html";
|
|
|
|
case "scripts":
|
|
|
|
topic = "{{ site.baseurl }}/pages/topic/scripts.html";
|
|
|
|
};
|
|
|
|
if (topic){
|
|
|
|
location.href = topic;
|
|
|
|
}
|
2018-11-13 08:54:50 +00:00
|
|
|
}
|
|
|
|
});
|
2018-11-08 08:21:27 +00:00
|
|
|
</script>
|
2018-11-02 15:00:59 +00:00
|
|
|
</body>
|
2018-10-30 17:09:13 +00:00
|
|
|
</html>
|