mirror of https://gitee.com/bigwinds/arangodb
95 lines
3.3 KiB
HTML
95 lines
3.3 KiB
HTML
{% macro articles(_articles) %}
|
||
{% for item in _articles %}
|
||
{% set externalLink = item.path|isExternalLink %}
|
||
<li class="chapter {% if item.path == _input %}active{% endif %}" data-level="{{ item.level }}" {% if item.path && !externalLink %}data-path="{{ item.path|mdLink }}"{% endif %}>
|
||
{% if item.path %}
|
||
{% if !externalLink %}
|
||
<a href="{{ basePath }}/{{ item.path|mdLink }}">
|
||
<i class="fa fa-check"></i>
|
||
{% if item.level !== "0" %}
|
||
<b>{{ item.level }}.</b>
|
||
{% endif %}
|
||
{{ item.title }}
|
||
</a>
|
||
{% else %}
|
||
<a target="_blank" href="{{ item.path }}">
|
||
<i class="fa fa-check"></i>
|
||
{% if item.level !== "0" %}
|
||
<b>{{ item.level }}.</b>
|
||
{% endif %}
|
||
{{ item.title }}
|
||
</a>
|
||
{% endif %}
|
||
{% else %}
|
||
<span><b>{{ item.level }}.</b> {{ item.title }}</span>
|
||
{% endif %}
|
||
{% if item.articles.length > 0 %}
|
||
<ul class="articles">
|
||
{{ articles(item.articles) }}
|
||
</ul>
|
||
{% endif %}
|
||
</li>
|
||
{% endfor %}
|
||
{% endmacro %}
|
||
|
||
<div class="book-summary">
|
||
<div class="book-search">
|
||
<a id="clear-search" href="#">×</a>
|
||
<input type="text" placeholder="Type to search" class="form-control" />
|
||
</div>
|
||
<ul class="summary">
|
||
{% set _divider = false %}
|
||
{% if options.links.sidebar %}
|
||
{% for link in options.links.sidebar %}
|
||
{% set _divider = true %}
|
||
<li>
|
||
<a href="{{ options.links.sidebar[loop.key] }}" target="blank" class="custom-link">{{ loop.key }}</a>
|
||
</li>
|
||
{% endfor %}
|
||
{% endif %}
|
||
|
||
{% if options.links.gitbook !== false %}
|
||
<li>
|
||
<a href="https://github.com/triAGENS/ArangoDB/issues" target="blank"class="issues-link"><i class="fa fa-github"></i> Have any issues? <i class="fa fa-external-link"></i></a>
|
||
<a href="http://stackoverflow.com/questions/tagged/arangodb" target="blank"><i class="fa fa-stack-overflow"></i> Have any questions? <i class="fa fa-external-link"></i></a>
|
||
</li>
|
||
{% endif %}
|
||
<li class="divider"></li>
|
||
{% if _divider %}
|
||
<li class="divider"></li>
|
||
{% endif %}
|
||
|
||
{{ articles(summary.chapters) }}
|
||
</ul>
|
||
</div>
|
||
<script src="https://code.jquery.com/jquery-1.9.1.min.js"></script>
|
||
<script type="text/javascript">
|
||
$(function(){
|
||
jQuery(".summary>li").each(function(){
|
||
var flag = true;
|
||
var x = window.location.href.split("/");
|
||
x = x[x.length - 2] + '/' + x[x.length - 1];
|
||
jQuery('a',this).each(function(){
|
||
var str = jQuery(this).attr('href');
|
||
if(str.search(x) != -1){
|
||
flag = false;
|
||
}
|
||
});
|
||
if(flag){
|
||
jQuery('ul',this).hide();
|
||
}
|
||
else {
|
||
jQuery(this).show();
|
||
jQuery("ul", this).show();
|
||
$(this).get(0).scrollIntoView();
|
||
}
|
||
});
|
||
});
|
||
</script>
|
||
<script type="text/javascript">
|
||
$('#clear-search').on('click', function(event){
|
||
event.preventDefault();
|
||
$('.book-search input').val("").trigger("keyup");
|
||
});
|
||
</script>
|