feat: Add hierarchical table of contents to documentation homepage

This commit is contained in:
Paul Gauthier (aider) 2025-03-21 13:17:34 -07:00
parent 2765d2fe66
commit 3ee5dc131d
2 changed files with 73 additions and 0 deletions

View file

@ -52,3 +52,18 @@ callouts:
title: Note
color: yellow
# Custom CSS for our table of contents
kramdown:
syntax_highlighter_opts:
css_class: highlight
sass:
style: compressed
# Additional CSS
compress_html:
clippings: all
comments: all
endings: all
startings: []

View file

@ -0,0 +1,58 @@
---
layout: default
title: Home
nav_order: 1
permalink: /
---
# Aider Documentation
Aider is AI pair programming in your terminal. This documentation will help you get the most out of aider.
## Table of Contents
<div class="toc">
{% assign pages_list = site.html_pages | sort:"nav_order" %}
{% assign top_level_pages = pages_list | where_exp:"item", "item.parent == nil and item.title != nil and item.nav_exclude != true" %}
<ul>
{% for page in top_level_pages %}
{% if page.title != nil and page.url != "/" %}
<li>
<a href="{{ page.url | absolute_url }}">{{ page.title }}</a>
{% assign children = pages_list | where:"parent", page.title | sort:"nav_order" %}
{% if children.size > 0 %}
<ul>
{% for child in children %}
<li>
<a href="{{ child.url | absolute_url }}">{{ child.title }}</a>
{% assign grandchildren = pages_list | where:"parent", child.title | sort:"nav_order" %}
{% if grandchildren.size > 0 %}
<ul>
{% for grandchild in grandchildren %}
<li>
<a href="{{ grandchild.url | absolute_url }}">{{ grandchild.title }}</a>
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endif %}
{% endfor %}
</ul>
</div>
## Quick Links
- [Installation Guide](/docs/installation)
- [Getting Started](/docs/getting-started)
- [Command Reference](/docs/commands)
- [Configuration Options](/docs/configuration)
## About Aider
Aider is an open-source tool that brings the power of AI coding assistants directly to your terminal. Use natural language to add features, fix bugs, and refactor code with an AI assistant that understands your entire codebase.