From b5ccc636c443380ea65ac7c622aacfa07be58033 Mon Sep 17 00:00:00 2001 From: david-swift Date: Tue, 25 Mar 2025 13:33:09 +0100 Subject: [PATCH] Implement docs table of contents #3 --- templates/docs.html | 21 +-------------------- templates/documentation_page.html | 4 ++++ templates/partials/docs_toc.html | 7 +++++++ 3 files changed, 12 insertions(+), 20 deletions(-) create mode 100644 templates/partials/docs_toc.html diff --git a/templates/docs.html b/templates/docs.html index af48475..3239532 100644 --- a/templates/docs.html +++ b/templates/docs.html @@ -22,25 +22,6 @@ {%- endfor -%} #} -{% include "partials/subprojects.html" %} +{% include "partials/docs_toc.html" %} -{%- if paginator.pages -%} - -{%- endif -%} {% endblock content %} diff --git a/templates/documentation_page.html b/templates/documentation_page.html index 0979621..e8af1a4 100644 --- a/templates/documentation_page.html +++ b/templates/documentation_page.html @@ -9,6 +9,8 @@ {%- set list_element = "ul" -%} {%- endif -%} +{%- set section = get_section(path=page.ancestors | last) -%} +
{%- if page.extra.banner -%}
diff --git a/templates/partials/docs_toc.html b/templates/partials/docs_toc.html new file mode 100644 index 0000000..ca3d0a7 --- /dev/null +++ b/templates/partials/docs_toc.html @@ -0,0 +1,7 @@ +
+ {%- for page in section.pages %} +
  • + {{ page.title }} +
  • + {%- endfor %} +