Using table of contents within the documentation.

This commit is contained in:
spf13
2014-01-28 23:29:05 -05:00
parent 1882ffabc6
commit 18b9948f1e
17 changed files with 59 additions and 9 deletions

View File

@@ -1,4 +1,10 @@
{{ template "chrome/header.html" . }}
{{ if .Params.notoc }}
{{ else }}
<div id="toc" class="well col-md-4 col-sm-6">
{{ .TableOfContents }}
</div>
{{ end }}
<h1>{{ .Title }}</h1>
{{ .Content }}
{{ template "chrome/footer.html" . }}

View File

@@ -12,7 +12,21 @@
</div>
<script src="/static/js/jquery.js"></script>
<script src="/static/js/bootstrap.min.js"></script>
<script>
$(document).ready(function() {
$("nav#TableOfContents a").click(function() {
$("html, body").animate({
scrollTop: $($(this).attr("href")).offset().top-25 + "px"
}, {
duration: 450,
});
return false;
});
});
</script>
{{ template "chrome/analytics.html" . }}
</body>
</html>