{% extends "base.html" %}
{% block main_content %}
    {% if page and page.meta.disable_tol %}
    <!-- TOL -->
    {% else %}
    {% if page.toc %}
    
    <div class="col-12 col-md-2 order-md-3 print-hide">
      <div class="collapse d-md-block text-nowrap" id="tol"  style="overflow-x:scroll;">
        <span>目次</span>
         <hr/>
        <ul class="list-group list-group-flush">
        {% for toc_item in page.toc %}
        <li class="list-group-item"><a class="text-decoration-none text-muted" href="{{ toc_item.url|url }}" >{{ toc_item.title }}</a>
          {% if toc_item.children %}
      <ul class="list-group list-group-flush">
          {% for toc_item in toc_item.children %}
              {% include "toc.html" %}
          {% endfor %}
      </ul>
          {% endif %}
          </li>
        {% endfor %}
      </ul>
      </div>
    </div>
    {% endif %}
    {% endif %}
    <div class="col-12 col-md-8 print-main">
    <h1>{{ page.title }}</h1>
    <nav aria-label="breadcrumb">
      <ol class="breadcrumb">
        <li class="breadcrumb-item active" aria-current="page">{{ config.site_name }}</li>
        {% for nav_item in nav %}
        {% if nav_item.active %}
        <li class="breadcrumb-item active" aria-current="page">{{ nav_item.title }}</li>
        {% if nav_item.children %}
        {% include "breadcrumb.html" %}
        {% endif %}
        {% endif %}
        {% endfor %}
      </ol>
    </nav>
    {% if page and page.meta.summary %}
        <p>{{ page.meta.summary }}</p>
    <hr/>
    {% endif %}
    {% if page and not page.meta.disable_tools %}
    <div class="d-flex justify-content-between">
      <div>
        {% if page.previous_page %}
        <a class="btn text-primary print-hide" href="{{ page.previous_page.url|url }}" title="{{ page.previous_page.title }}"><i class="bi bi-chevron-left"></i></a>
        {% else %}
        <a class="btn text-muted print-hide"><i class="bi bi-chevron-left"></i></a>
        {% endif %}
        {% if page.next_page %}
        <a class="btn text-primary print-hide" href="{{ page.next_page.url|url }}" title="{{ page.next_page.title }}"><i class="bi bi-chevron-right"></i></a>
        {% else %}
        <a class="btn text-muted print-hide"><i class="bi bi-chevron-right"></i></a>
        {% endif %}
      </div>
      <div>
        <div>
          {% if page and page.meta.author %}
          {% if page and page.meta.author_url %}
          <a href="{{ page.meta.author_url }}">{{ page.meta.author }}</a>
          {% else %}
          <span>{{ page.meta.author }}</span>
          {% endif %}
          <span>|</span>
          {% else %}
          {% if git_page_authors %}
          <small>{{ git_page_authors | default('enable mkdocs-git-authors-plugin') }}</small>
          <span>|</span>
          {% endif %}
          {% endif %}
          {% if page and page.meta.date %}
          <span>{{ page.meta.date }}</span>
          {% endif %}
          <button class="btn print-block" title="このページを印刷" onclick="window.print();"><i class="bi bi-printer"></i></button>
          <button class="btn print-visible d-none" onclick="print_normal();" title="新しいタブで開く"><i class="bi bi-arrow-up-right-square"></i></button>
          {% if page and not page.meta.disable_edit %}
          {% if page and page.edit_url %}
          <a class="btn print-hide" href="{{ page.edit_url }}"><i class="bi bi-pencil"></i></a>
          {% elif config.repo_url %}
          <a class="btn print-hide" href="{{ config.repo_url }}"><i class="bi bi-pencil"></i></a>
          {% else %}
          <a class="btn disabled print-hide"><i class="bi bi-pencil"></i></a>
          {% endif %}
          <span class="dropdown print-hide">
            <button class="btn" type="button" id="dropdownMenuButton1" data-bs-toggle="dropdown" aria-expanded="false"><i class="bi bi-share"></i></button>
            <ul class="dropdown-menu" aria-labelledby="dropdownMenuButton1">
              <li><a class="btn dropdown-item" href="https://twitter.com/share?ref_src=twsrc%5Etfw"><i class="bi bi-twitter"></i>&nbsp;Twitter</a></li>
              <li><button class="btn dropdown-item" onclick="share_to_facebook();"><i class="bi bi-facebook"></i>&nbsp;Facebook</button></li>
              <li><button class="btn dropdown-item" onclick="print_view();"><i class="bi bi-file-earmark-text"></i>&nbsp;埋込モードで表示</button></li>
              <li><button class="btn dropdown-item" onclick="page_copy_btn_clicked(this);"><i class="bi bi-clipboard"></i>&nbsp;URLをコピー</button></li>
            </ul>
          </span>
          {% endif %}
        </div>
      </div>
    </div>
    <hr/>
    {% endif %}
    {% block content %}
      {{ page.content }}
    {% endblock %}
    
{% endblock %}