{% extends "base.html" %}
{% block title %}{{ page.title }} | {{ config.title }}{% endblock title %}
{% block toc %}
{% set docs_section = get_section(path="_index.md") %}
{{ macros::toc_nav(docs_section=docs_section, current_page=page) }}
{% endblock toc %}
{% block content_id %}{{ page.slug }}{% endblock content_id %}
{% block content %}
<h1 class="heading-text"><a href="#{{ page.slug }}" class="heading-anchor">{{ page.title }}</a></h1>
{{ page.content | safe }}
{# Calculate prev/next from section pages #}
{% set prev_page = false %}
{% set next_page = false %}
{% set found_current = false %}
{% for doc_page in docs_section.pages %}
{% if found_current and not next_page %}
{% set_global next_page = doc_page %}
{% endif %}
{% if doc_page.permalink == page.permalink %}
{% set_global found_current = true %}
{% endif %}
{% if not found_current %}
{% set_global prev_page = doc_page %}
{% endif %}
{% endfor %}
<div class="page-nav">
{% if prev_page %}
<a href="{{ prev_page.permalink | safe }}">← {{ prev_page.title }}</a>
{% else %}
<span></span>
{% endif %}
{% if next_page %}
<a href="{{ next_page.permalink | safe }}">{{ next_page.title }} →</a>
{% endif %}
</div>
{% endblock content %}