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-15 20:54:09 +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');
|
2018-11-08 08:21:27 +00:00
|
|
|
|
2018-11-15 20:54:09 +00:00
|
|
|
var sjs = SimpleJekyllSearch({
|
|
|
|
searchInput: searchBar,
|
|
|
|
resultsContainer: results,
|
|
|
|
json: '/search.json',
|
|
|
|
searchResultTemplate:
|
|
|
|
'<li><a href="{url}"><h3>{title}</h3><h4>{category}</h4></a></li>',
|
|
|
|
success: function(sr) {
|
|
|
|
results.setAttribute("class", sr.length <= 1 ? "" : "show");
|
|
|
|
}
|
|
|
|
});
|
2018-11-08 08:21:27 +00:00
|
|
|
|
2018-11-15 20:54:09 +00:00
|
|
|
searchBar.addEventListener('keypress', function () {
|
|
|
|
sjs.search();
|
|
|
|
});
|
|
|
|
});
|
2018-11-13 08:54:50 +00:00
|
|
|
|
2018-11-15 20:54:09 +00:00
|
|
|
document.addEventListener("keypress", function(event) {
|
|
|
|
switch (event.key) {
|
|
|
|
case "w":
|
|
|
|
case "k":
|
|
|
|
window.scrollTo (0,0);
|
|
|
|
break;
|
|
|
|
case "a":
|
|
|
|
case "h":
|
|
|
|
var previous = "{{ page.previous-page }}";
|
|
|
|
if (previous) {
|
|
|
|
location.href = "{{ site.baseurl }}/" + previous;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case "d":
|
|
|
|
case "l":
|
|
|
|
var next = "{{ page.next-page }}";
|
|
|
|
if (next) {
|
|
|
|
location.href = "{{ site.baseurl }}/" + next;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case "s":
|
|
|
|
case "j":
|
|
|
|
var topicPage;
|
|
|
|
var topic = "{{ page.category-page }}";
|
|
|
|
switch (topic) {
|
|
|
|
case "basic":
|
|
|
|
case "intermediate":
|
|
|
|
case "advanced":
|
|
|
|
topicPage = "{{ site.baseurl }}/pages/topic/cmd/" + topic + ".html";
|
|
|
|
break;
|
|
|
|
case "fs":
|
|
|
|
case "scripts":
|
|
|
|
topicPage = "{{ site.baseurl }}/pages/topic/" + topic + ".html";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (topicPage) {
|
|
|
|
location.href = topicPage;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case "~":
|
|
|
|
location.href = "{{ site.baseurl }}/";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
2018-11-02 15:00:59 +00:00
|
|
|
</body>
|
2018-10-30 17:09:13 +00:00
|
|
|
</html>
|