Implement docs table of contents #3

This commit is contained in:
david-swift 2025-03-25 13:33:09 +01:00
parent e0fb064b1d
commit b5ccc636c4
3 changed files with 12 additions and 20 deletions

View File

@ -22,25 +22,6 @@
{%- endfor -%} {%- endfor -%}
</div> #} </div> #}
{% include "partials/subprojects.html" %} {% include "partials/docs_toc.html" %}
{%- if paginator.pages -%}
<nav id="paginator">
{%- if paginator.previous -%}
<a id="paginator-previous" href="{{ paginator.previous }}">
<i class="icon"></i>
<div>{{ macros_translate::translate(key='previous', default='Previous', language_strings=language_strings) }}</div>
</a>
{%- endif -%}
<div></div>
{%- if paginator.next -%}
<a id="paginator-next" href="{{ paginator.next }}">
<div>{{ macros_translate::translate(key='next', default='Next', language_strings=language_strings) }}</div>
<i class="icon"></i>
</a>
{%- endif -%}
</nav>
{%- endif -%}
{% endblock content %} {% endblock content %}

View File

@ -9,6 +9,8 @@
{%- set list_element = "ul" -%} {%- set list_element = "ul" -%}
{%- endif -%} {%- endif -%}
{%- set section = get_section(path=page.ancestors | last) -%}
<article> <article>
{%- if page.extra.banner -%} {%- if page.extra.banner -%}
<div id="banner-container"> <div id="banner-container">
@ -112,6 +114,8 @@
{%- include "partials/toc.html" -%} {%- include "partials/toc.html" -%}
{%- endif -%} {%- endif -%}
{% include "partials/docs_toc.html" %}
{{ page.content | safe }} {{ page.content | safe }}
</article> </article>

View File

@ -0,0 +1,7 @@
<div id="docs">
{%- for page in section.pages %}
<li>
<a href="{{ page.permalink | safe }}">{{ page.title }}</a>
</li>
{%- endfor %}
</div>