{% extends 'keylighter.html.twig' %}
{% set current = 'docs' %}

{% import 'macros.twig' as helpers %}

{% block content %}
    <div class="row">
        <div class="col-md-3">
            <div id="sidebar" class="sticky-top">
                <h2>Documentation</h2>
                {{ render_esi(controller("App\\Controller\\DocumentationController:sidebarAction", { path: path })) }}
            </div>
        </div>
        <div class="col-md-9">
            <nav class="d-flex justify-content-end">
                <a href="https://github.com/kadet1090/KeyLighter/edit/master/Docs/{{ path }}.md" class="btn btn-outline-primary">
                    <i class="{{ fa('github', 'brand') }}"></i> edit on github
                </a>
            </nav>
            {{ document.content|markdown }}
            <nav class="d-flex chapter--navigation">
                {% if prev %}
                    <a href="{{ document.metadata['previous'] }}" class="btn btn-outline-primary nav--prev">
                        <i class="far fa-chevron-left"></i> {{ helpers.document_link(prev) }}
                    </a>
                {% endif %}

                {% if next %}
                    <a href="{{ document.metadata['next'] }}" class="btn btn-outline-primary nav--next">
                        {{ helpers.document_link(next) }} <i class="far fa-chevron-right"></i>
                    </a>
                {% endif %}
            </nav>
        </div>
    </div>
{% endblock %}