{% extends "./layout.html" %}

{% block title %}{{ page.title }} · {{ super() }}{% endblock %}

{% block description %}{{ page.description }}{% endblock %}

{% block head %}
    {{ super() }}
    {% if page.next and page.next.path %}
    <link rel="next" href="{{ page.next.path|resolveFile }}" />
    {% endif %}
    {% if page.previous and page.previous.path %}
    <link rel="prev" href="{{ page.previous.path|resolveFile }}" />
    {% endif %}
{% endblock %}

{% block javascript %}
    <script src="{{ "gitbook.js"|resolveAsset }}"></script>
    <script src="{{ "theme.js"|resolveAsset }}"></script>
    {% for resource in plugins.resources.js %}
        {% if resource.url %}
        <script src="{{ resource.url }}"></script>
        {% else %}
        <script src="{{ resource.path|resolveAsset }}"></script>
        {% endif %}
    {% endfor %}
{% endblock %}

{% block body %}
<div class="book">

    <div class="header-inner">
		<!-- LOGO -->
		<div class="book-logo">   
            {% if config.pluginsConfig["theme-gestalt-yl"].logo %}
            <img src="{{ config.pluginsConfig["theme-gestalt-yl"].logo }}"/>
            {% endif %}
        </div>
        <div class="title">文档中心<span class="dot">.</span>{{ config.title|d("GitBook", true) }}</div>
        <div class="more dropdown">
            <i class="fa fa-angle-down toggle-dropdown" aria-hidden="true"></i>
            <div class="dropdown-menu dropdown-right">
                <div class="dropdown-caret"><span class="caret-outer"></span>
                    <span class="caret-inner"></span>
                </div>
                 <div class="main-doc-list">
                     <ul>
                        {% for part in summary.parts %}
                            {% for article in part.articles %}
                                {% if not loop.first %}
                                    <li><a href="{{ article.path|resolveFile }}{{ article.anchor }}">{{ article.title }}</a></li>
                                {% endif %}
                            {% endfor %}
                        {% endfor %}
                     </ul>
                 </div>
            </div>
        </div>
        

        <div id="book-search-input" role="search">
            <input type="text" placeholder="输入并搜索">
            <i class="fa fa-neuter"></i>
        </div>
		
    </div>
    
    <div class="book-summary">
        {% block book_sidebar %}
            {% block book_summary %}
                <nav role="navigation">
                {% include "website/summary.html" %}
                </nav>
            {% endblock %}
        {% endblock %}
    </div>

    <!-- Content nav -->
	<div class="book-anchor">
		<div class="book-anchor-title"></div>
		<div class="book-anchor-body">

		</div>
	</div>

    <div class="book-body">
        {% block book_body %}
            <div class="body-inner">
                {% block book_inner %}
                    {% include "website/header.html" %}

                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            {% block search_results %}
                                <section class="normal markdown-section">
                                {% block page %}
                                {{ page.content|safe }}
                                {% endblock %}
                                </section>
                            {% endblock %}
                        </div>
                        {% block book_navigation %}
                            {% if config.pluginsConfig["theme-gestalt-yl"].prevNextNav and page.previous and page.previous.path %}
                            <a href="{{ page.previous.path|resolveFile }}{{ page.previous.anchor }}" class="navigation navigation-prev {% if not (page.next and page.next.path) %}navigation-unique{% endif %}" aria-label="Previous page: {{ page.previous.title }}">
                                <i class="fa fa-angle-left"></i>
                            </a>
                            {% endif %}
                            {% if config.pluginsConfig["theme-gestalt-yl"].prevNextNav and page.next and page.next.path %}
                            <a href="{{ page.next.path|resolveFile }}{{ page.next.anchor }}" class="navigation navigation-next {% if not (page.previous and page.previous.path) %}navigation-unique{% endif %}" aria-label="Next page: {{ page.next.title }}">
                                <i class="fa fa-angle-right"></i>
                            </a>
                            {% endif %}
                        {% endblock %}
                    </div>
                {% endblock %}
            </div>


        {% endblock %}
    </div>
    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({{ template.getJSContext()|dump|safe }});
        });
    </script>
</div>
{% endblock %}
