{% extends "base.html" %}
{% from "chirpui/hero.html" import page_hero %}
{% from "chirpui/layout.html" import container, stack %}
{% from "partials/learning-pages.html" import content_cards, progress_for, rendered_body %}
{% block content %}
{% let title = page?.title ?? "Track" %}
{% let description = page?.description ?? params?.description ?? none %}
{% let lessons = posts ?? pages ?? page?.children ?? section?.pages ?? section?.regular_pages ?? [] %}
{% let current_step = params?.current_step ?? 1 %}
{% call container(cls="chirp-theme-learning-page chirp-theme-track-page") %}
{% call stack(gap="lg") %}
{% call page_hero(title=title, subtitle=description, variant="minimal", background="solid", cls="chirp-theme-learning-hero") %}
{% slot metadata %}{{ lessons | length }} lesson{{ "s" if lessons | length != 1 else "" }}{% end %}
{% end %}
{{ progress_for(lessons, current_step) }}
{{ rendered_body(content) }}
{{ content_cards(lessons, "No lessons have been added to this track yet.", "lesson") }}
{% end %}
{% end %}
{% end %}