Versions

{% assign docsRoot = "https://docs.github.com" %} {% if allVersions[currentVersion] %}

TOC for {{ allVersions[currentVersion].versionTitle }}

{% assign maxTocDepth = 5 %} {% for productPage in currentEnglishTree.childPages %} {% assign productId = productPage.page.relativePath | replace: "/index.md", "" %} {% if defaultOpenSections contains productId %}
{{productPage.renderedFullTitle}} {% else %}
{{productPage.renderedFullTitle}} {% endif %}
  • {{ productPage.renderedFullTitle }} {% comment %} Unified nested rendering with depth control {% endcomment %} {% if productPage.childPages and productPage.childPages.size > 0 %}
      {% for l1 in productPage.childPages %}
    • {{ l1.renderedFullTitle }} {% if l1.childPages and l1.childPages.size > 0 and maxTocDepth >= 2 %}
        {% for l2 in l1.childPages %}
      • {{ l2.renderedFullTitle }} {% if l2.childPages and l2.childPages.size > 0 and maxTocDepth >= 3 %} {% endif %}
      • {% endfor %}
      {% endif %}
    • {% endfor %}
    {% endif %}
{% endfor %} {% endif %}