docs: Add a github pages html template
Add an html template so that each page has a navbar at the top and a sidebar on the left with an auto-generated table of contents. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
64e7235e48
commit
4739e28137
|
@ -0,0 +1,105 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
{% seo %}
|
||||
|
||||
<!-- Bootstrap css -->
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
|
||||
|
||||
<!-- Fixup markdown code blocks -->
|
||||
<style>
|
||||
.markdown-body pre {
|
||||
background-color: #f6f8fa;
|
||||
line-height: 1.45;
|
||||
overflow: auto;
|
||||
padding: 16px;
|
||||
}
|
||||
.markdown-body code, .markdown-body tt {
|
||||
background-color: rgba(27,31,35,.1);
|
||||
color: inherit;
|
||||
border-radius: 3px;
|
||||
font-size: 85%;
|
||||
margin: 0;
|
||||
padding: .2em .4em;
|
||||
}
|
||||
.markdown-body pre code {
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- Navbar at top of page -->
|
||||
<nav class="navbar navbar-expand-md navbar-light bg-light">
|
||||
<a class="navbar-brand" href="/">Klipper</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNavAltMarkup">
|
||||
<div class="navbar-nav ml-auto">
|
||||
<a class="nav-item nav-link" href="Overview.html">Index</a>
|
||||
<a class="nav-item nav-link" href="https://github.com/KevinOConnor/klipper">Github</a>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
|
||||
<!-- Sidebar for table of contents -->
|
||||
<nav class="d-none d-md-block col-md-3 bg-light">
|
||||
<ul id="toc" class="px-0" style="list-style: none">
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<!-- Main markdown contents -->
|
||||
<main class="col-md-9 ml-md-auto px-4">
|
||||
<div class="markdown-body" style="max-width: 800px">
|
||||
{{ content }}
|
||||
</div>
|
||||
</main>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Google analytics javascript -->
|
||||
{% if site.google_analytics %}
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
ga('create', '{{ site.google_analytics }}', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script>
|
||||
{% endif %}
|
||||
|
||||
<!-- Bootstrap / jquery javascript -->
|
||||
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
|
||||
|
||||
<!-- Javascript to automatically add table of contents -->
|
||||
<style>
|
||||
.toc-item {
|
||||
font-size: 80%;
|
||||
line-height: 80%;
|
||||
padding-top: .5em;
|
||||
padding-bottom: .5em;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$('.markdown-body').find('h1, h2, h3, h4, h5, h6').each(function() {
|
||||
var $item = $(this);
|
||||
var $id = $(this).attr('id');
|
||||
var li = $('<li class="toc-item"/>');
|
||||
var a = $('<a/>', {text: $item.text(), href: '#' + $id, title: $item.text()});
|
||||
a.appendTo(li);
|
||||
$('#toc').append(li);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue