{% extends "base.html" %} {# Tutorial List Template Used for tutorial section indexes. Displays tutorials in a grid with difficulty levels, time estimates, and visual indicators. Usage: Set `type: tutorial` in section _index.md Context variables: - section: Section object with tutorials - posts: List of tutorial pages - subsections: Tutorial categories/groups #} {% from 'partials/navigation-components.html' import breadcrumbs %} {% block content %} {{ breadcrumbs(page if page is defined else section) }}

📚 {{ section.title if section else title | default('Tutorials') }}

{% if section and section.metadata.get('description', '') %}

{{ section.metadata.get('description', '') }}

{% elif description is defined %}

{{ description }}

{% else %}

Step-by-step guides to help you learn and master the topics.

{% endif %}
{# Tutorial Statistics #} {% if posts %}
{{ posts | length }} {{ 'tutorial' if posts | length == 1 else 'tutorials' }}
{% set beginner_count = posts | where('difficulty', 'beginner') | length %} {% set intermediate_count = posts | where('difficulty', 'intermediate') | length %} {% set advanced_count = posts | where('difficulty', 'advanced') | length %} {% if beginner_count > 0 %}
{{ beginner_count }} beginner
{% endif %} {% if intermediate_count > 0 %}
{{ intermediate_count }} intermediate
{% endif %} {% if advanced_count > 0 %}
{{ advanced_count }} advanced
{% endif %}
{% endif %} {# Tutorial Grid #} {% if posts or subsections %}
{# Subsections (Tutorial Categories) #} {% if subsections %}

Categories

{% for subsection in subsections %}
{% if subsection.metadata.get('description', '') %}

{{ subsection.metadata.get('description', '') | truncate(150) }}

{% endif %}
{% if subsection.regular_pages %} {# Count only non-index pages #} {% set content_pages = subsection.regular_pages | rejectattr('url', 'equalto', subsection.index_page.url if subsection.index_page else '') | list %} {% if content_pages %} {{ content_pages | length }} tutorial{{ 's' if content_pages | length != 1 }} {% endif %} {% endif %}
{% endfor %}
{% endif %} {# Individual Tutorials #} {% if posts %}

All Tutorials

{% for tutorial in posts %}
{% if tutorial.metadata.get('icon') %} {{ tutorial.metadata.get('icon') }} {% else %} 📖 {% endif %}

{{ tutorial.title }}

{% if tutorial.metadata.get('description', '') %}

{{ tutorial.metadata.get('description', '') | truncate(150) }}

{% elif tutorial.excerpt %}

{{ tutorial.excerpt | truncate(150) }}

{% endif %}
{# Difficulty Badge #} {% if tutorial.metadata.get('difficulty') %} {{ tutorial.metadata.get('difficulty') | capitalize }} {% endif %} {# Time Estimate #} {% if tutorial.metadata.get('time') or tutorial.metadata.get('duration') %} {{ tutorial.metadata.get('time') | default(tutorial.metadata.get('duration')) }} {% endif %} {# Prerequisites #} {% if tutorial.metadata.get('prerequisites') %} {{ tutorial.metadata.get('prerequisites') | length }} prerequisite{{ 's' if tutorial.metadata.get('prerequisites') | length != 1 }} {% endif %}
Start tutorial →
{% endfor %}
{% endif %}
{% else %} {# Empty State #}

No tutorials available yet.

{% endif %}
{% endblock %}