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

{%- macro toc() %}
    <a href="{{ pathto(master_doc) }}">Table of contents</a>
{%- endmacro %}

{%- macro prev_next() %}
<div class="prev-next">
    {%- if prev and prev != master_doc %}
    <div class="left">
        <a href="{{ prev.link }}">← {{ prev.title }}</a>
    </div>
    {%- endif %}

    <div class="middle">
    {%- if pagename != master_doc and next %}
        {{- toc() }}
    {%- else %}
    &nbsp;
    {%- endif %}
    </div>

    <div class="right">
    {%- if next %}
        <a href="{{ next.link }}">{{ next.title }} →</a>
    {%- else %}
        {{- toc() }}
    {%- endif %}
    </div>
</div>
{%- endmacro %}

{%- block relbar1 %}{% endblock %}
{%- block relbar2 %}
{%- if not site %}{{ prev_next() }}{% endif %}
{%- endblock %}

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

{%- macro toc() %}
    <a href="{{ pathto(master_doc) }}">Table of contents</a>
{%- endmacro %}

{%- macro prev_next() %}
<div class="prev-next">
    {%- if prev and prev != master_doc %}
    <div class="left">
        <a href="{{ prev.link }}">← {{ prev.title }}</a>
    </div>
    {%- endif %}

    <div class="middle">
    {%- if pagename != master_doc and next %}
        {{- toc() }}
    {%- else %}
    &nbsp;
    {%- endif %}
    </div>

    <div class="right">
    {%- if next %}
        <a href="{{ next.link }}">{{ next.title }} →</a>
    {%- elif prev %}
        {{- toc() }}
    {%- endif %}
    </div>
</div>
{%- endmacro %}

{%- block relbar1 %}{% endblock %}
{%- block relbar2 %}
{%- if not site %}{{ prev_next() }}{% endif %}
{%- endblock %}

Remove TOC link from the search page
Remove TOC link from the search page
