theshell.ch/site/_layouts/main.html

43 lines
1.1 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html>
{% include head.html %}
<body id="bdy">
<header class="header">
{% include header.html %}
</header>
<main class="container">
{{ content }}
</main>
{% include footer.html %}
<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:
'<li><a href="{url}"><h3>{title}</h3><h4>{category}</h4></a></li>',
success: function(sr) {
results.setAttribute("class", sr.length <= 1 ? "" : "show");
}
});
searchBar.addEventListener('keypress', function () {
sjs.search();
});
});
var bdy = document.getElementById("bdy");
document.addEventListener("keypress", function(event){
if(event.key == "q"){
window.scrollTo (0,0);
}
});
</script>
</body>
</html>