{% extends "root.j2" %}
{% block main -%}
<div class="doc">
    <article>
    <hgroup>
        <h1 class="title">{{ resource.meta.title }}</h1>
        <h3 class="subtitle">{{ resource.meta.subtitle }}</h3>
    </hgroup>
    {% filter markdown|typogrify -%}
    {% block doc -%}
    {%- endblock %}
    {%- endfilter %}
    </article>
    <aside>
        <ul class="toc">
        <li><mark class="version">Version: {{ project.version }}</mark></li>
        {% for topic, res_walker in site.content.walk_toc_groups() -%}
        {% set resources = res_walker|list -%}
        {% if resources -%}
        {% set cls = ' active' if topic in resource.walk_toc_groups() else '' -%}
        <li class="topic" id="topic{{ loop.index0 }}">
            {% if not topic.hide_name -%}
            <h2 class="{{cls}}">{{ topic.name|title|typogrify }}</h2>
            {%- endif %}
            <ul class="links">
                {% for doc in resources -%}
                <li>
                <a {% if resource.url == doc.url %}class="active"{% endif %}
                    title="{{ doc.meta.description|default('') }}"
                    href="{{ content_url(doc.url) }}">
                    {{ doc.meta.title|typogrify }}</a>
                {%- endfor %}
                </li>
            </ul>
        </li>
        {%- endif %}
        {%- endfor %}
        </ul>
        <nav class="prevnext">
            {% if resource.prev_in_toc -%}
            <a
                class="prev"
                title="{{ resource.prev_in_toc.meta.title }}"
                href="{{ content_url(resource.prev_in_toc.url) }}">
                &larr;Previous
            </a>
            {%- endif %}
            {% if resource.next_in_toc -%}
            <a
                class="next"
                title="{{ resource.next_in_toc.meta.title }}"
                href="{{ content_url(resource.next_in_toc.url) }}">
                Next&rarr;
            </a>
            {%- endif %}
            <br class="clear">
        </nav>
    </aside>
</div>
<footer>
{% filter markdown|typogrify %}
[smelted with hyde](https://github.com/hyde/hyde) &mdash;
[fork & hack away]({{ project.page }})<br>
{{ project.ack }}
{% endfilter %}
</footer>
{%- endblock %}
