mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-23 21:53:09 +02:00
Using table of contents within the documentation.
This commit is contained in:
@@ -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" . }}
|
||||
|
@@ -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>
|
||||
|
Reference in New Issue
Block a user