提交 7949d2ff 编写于 作者: E edisonxiang

add treeview for docs

上级 80139541
...@@ -23,3 +23,5 @@ ...@@ -23,3 +23,5 @@
Made with Book Theme Made with Book Theme
https://github.com/alex-shpak/hugo-book https://github.com/alex-shpak/hugo-book
{{ "-->" | safeHTML }} {{ "-->" | safeHTML }}
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/jstree/3.3.4/themes/default/style.min.css" />
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
{{ partial "docs/inject/menu-before" . }} {{ partial "docs/inject/menu-before" . }}
{{ if .Site.Params.BookMenuBundle }} {{ if .Site.Params.BookMenuBundle }}
<div id="docstreeview">
{{ partial "docs/menu-bundle" . }} {{ partial "docs/menu-bundle" . }}
</div>
{{ else }} {{ else }}
{{ partial "docs/menu-filetree" . }} {{ partial "docs/menu-filetree" . }}
{{ end }} {{ end }}
......
{{ template "_internal/google_analytics.html" . }} {{ template "_internal/google_analytics.html" . }}
<script src="//code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script> <script src="//code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jstree/3.3.4/jstree.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/waypoints/4.0.1/jquery.waypoints.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/waypoints/4.0.1/jquery.waypoints.min.js"></script>
...@@ -17,3 +18,15 @@ ...@@ -17,3 +18,15 @@
<!-- owl carousel --> <!-- owl carousel -->
<script src="{{ .Site.BaseURL }}js/owl.carousel.min.js"></script> <script src="{{ .Site.BaseURL }}js/owl.carousel.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#docstreeview').jstree();
$('#docstreeview').jstree().open_all();
$('#docstreeview').jstree().hide_dots();
$('#docstreeview').jstree().hide_icons();
$('#docstreeview').on("changed.jstree", function(e, data) {
location.href=data.node.a_attr.href;
});
});
</script>
...@@ -348,7 +348,12 @@ footer .notice span { ...@@ -348,7 +348,12 @@ footer .notice span {
} }
#error-page .box { #error-page .box {
margin-top: 60px; margin-top: 148px;
margin-bottom: 148px;
}
.jstree-default .jstree-anchor {
height: 35px !important;
} }
html { html {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册