{# API Hub Landing Page Template Premium landing page for API documentation, displaying all available API types (Python, REST, CLI) in a beautiful tile layout with a hero banner. Mirrors the design language of home.html and tracks/list.html: - Hero section with badge, title, description - Stats bar showing API counts - Tile grid with type-specific icons and badges - Staggered animation on load Usage: Auto-selected for api-hub sections or set template: api-hub/home.html #} {% extends "base.html" %} {% block content %}
{# Hero Section #}
{# Badge #} API Reference {# Title #}

{{ (section.title if section else page.title) | default('API Documentation') }}

{# Description #} {% set desc = (section.metadata.get('description', '') if section else '') or page.metadata.get('description', '') %} {% if desc %}

{{ desc }}

{% else %}

Explore comprehensive API documentation for Python modules, REST endpoints, and CLI commands.

{% endif %} {# Stats Bar #} {% if section and section.sorted_subsections %}
{% set python_count = 0 %} {% set rest_count = 0 %} {% set cli_count = 0 %} {% for sub in section.sorted_subsections %} {% set sub_type = sub.metadata.get('type', '') %} {% if 'python' in sub_type %} {% set python_count = python_count + 1 %} {% elif 'openapi' in sub_type %} {% set rest_count = rest_count + 1 %} {% elif 'cli' in sub_type %} {% set cli_count = cli_count + 1 %} {% endif %} {% endfor %}
{{ section.sorted_subsections | length }} API{{ 's' if section.sorted_subsections | length != 1 else '' }}
{% if python_count > 0 %}
{{ icon("code", size=16) }} {{ python_count }} Python
{% endif %} {% if rest_count > 0 %}
{{ icon("globe", size=16) }} {{ rest_count }} REST
{% endif %} {% if cli_count > 0 %}
{{ icon("terminal", size=16) }} {{ cli_count }} CLI
{% endif %}
{% endif %}
{# Custom Content from _index.md #} {% if content is defined and content and content.strip() %}
{{ content | safe }}
{% endif %} {# API Tiles Grid #} {% if section and section.sorted_subsections %}
{% for subsection in section.sorted_subsections %} {% set sub_type = subsection.metadata.get('type', 'python-reference') %} {% set desc = subsection.metadata.get('description', '') | first_sentence %} {% set child_count = (subsection.subsections | length) + (subsection.pages | length) %}
{# Type Badge #}
{%- if 'python' in sub_type -%} {{ icon("code", size=12) }} Python {%- elif 'openapi' in sub_type -%} {{ icon("globe", size=12) }} REST {%- elif 'cli' in sub_type -%} {{ icon("terminal", size=12) }} CLI {%- else -%} {{ icon("book", size=12) }} API {%- endif -%}
{# Tile Header with Icon #}
{%- if 'python' in sub_type -%} {{ icon("code", size=32, css_class="icon-python") }} {%- elif 'openapi' in sub_type -%} {{ icon("globe", size=32, css_class="icon-openapi") }} {%- elif 'cli' in sub_type -%} {{ icon("terminal", size=32, css_class="icon-cli") }} {%- else -%} {{ icon("book", size=32, css_class="icon-default") }} {%- endif -%}

{{ subsection.title }}

{# Tile Content #}

{% if desc %} {{ desc }} {% else %} {# Default descriptions based on type #} {%- if 'python' in sub_type -%} Browse Python packages, modules, classes, and functions. {%- elif 'openapi' in sub_type -%} Explore REST API endpoints, parameters, and response schemas. {%- elif 'cli' in sub_type -%} Command-line interface documentation with options and examples. {%- else -%} API documentation and reference material. {%- endif -%} {% endif %}

{# Preview Items #} {% if subsection.sorted_subsections or subsection.sorted_pages %}
Includes:
    {% set preview_limit = 4 %} {% set preview_items = subsection.sorted_subsections[:preview_limit] if subsection.sorted_subsections else subsection.sorted_pages[:preview_limit] %} {% for item in preview_items %}
  • {{ item.title | default(item.name) }}
  • {% endfor %} {% set remaining = child_count - preview_limit %} {% if remaining > 0 %}
  • +{{ remaining }} more
  • {% endif %}
{% endif %}
{# Tile Footer #}
{% endfor %}
{% else %} {# Empty State #}
{{ icon('book-open', size=64) }}

No API Documentation Yet

Enable Python, OpenAPI, or CLI autodoc in your autodoc.yaml configuration to generate API documentation.

{% endif %}
{% endblock %}