{# Track Single Page Template Pillar page-style layout for learning tracks with: - Left sidebar: Other tracks + progress - Center: Track content (pillar page style) - Right sidebar: TOC from all track sections Usage: Set `template: tracks/single.html` in frontmatter Or set `type: track` to auto-select this template #} {% extends "base.html" %} {% from 'partials/navigation-components.html' import toc with context %} {% block content %} {% set track_id = page.metadata.get('track_id') or page.slug %} {% set track = site.data.tracks[track_id] if (track_id and site.data.tracks and track_id in site.data.tracks) else none %} {# Three-column pillar page layout #}
{# Left Sidebar: Track Navigation + Progress #} {# Main Content: Pillar Page Style #}
{# Track Header #}
{# Main Page Content (Introduction) #} {% if content %}
{{ content | safe }}
{% endif %} {# Track Contents Overview (Compact) #} {% if track and track.items %}

Track Contents

{% for item_slug in track.items %} {% set item_page = get_page(item_slug) %} {% if item_page %} {{ loop.index }}
{{ item_page.title }}
{% if item_page.description %}
{{ item_page.description }}
{% endif %}
{% endif %} {% endfor %}
{% endif %} {# Render All Track Pages Sequentially (Pillar Page Content) #} {% if track and track.items %}
{% for item_slug in track.items %} {% set item_page = get_page(item_slug) %} {% if item_page %}
{# Section Header #}
{{ loop.index }}

{{ item_page.title }}

{% if item_page.description %}

{{ item_page.description }}

{% endif %}
{# Section Content #}
{% if item_page.parsed_ast %} {# Use parsed_ast and update heading IDs to be unique #} {# Note: In a real implementation, you'd want to update heading IDs here #} {{ item_page.parsed_ast | safe }} {% elif item_page.content %} {# Fallback to rendered content if parsed_ast not available #} {{ item_page.content | safe }} {% else %}

Content Unavailable

This page has no content available.

View Full Page: {{ item_page.title }} →

{% endif %}
{# Section Navigation #}
{% if loop.index > 1 %} {% set prev_slug = track.items[loop.index - 2] %} {% set prev_page = get_page(prev_slug) %} {% if prev_page %} ← Previous: {{ prev_page.title }} {% endif %} {% else %} {% endif %} {% if not loop.last %} {% set next_slug = track.items[loop.index] %} {% set next_page = get_page(next_slug) %} {% if next_page %} Next: {{ next_page.title }} → {% endif %} {% else %}
✓ Track Complete
{% endif %}
{% else %} {# Missing Page Warning #}

Section {{ loop.index }}: Page Not Found

Could not find page: {{ item_slug }}

{% endif %} {% endfor %}
{% elif not track %}

Track Not Found

Could not find a track definition with ID {{ track_id }} in site/data/tracks.yaml.


Please ensure the page slug matches the track key, or set track_id in frontmatter.

{% endif %}
{# Right Sidebar: TOC from all track sections #} {# Combine TOC items from all track section pages #} {% if track and track.items %} {% set combined_toc_items = combine_track_toc(track.items) %} {% if combined_toc_items %} {% endif %} {% elif page.toc_items %} {# Fallback to page TOC if no track sections #} {% endif %}
{# Mobile sidebar toggle button #} {# Mobile sidebar overlay #} {% endblock %}