{% extends "base.html" %} {# ================================================================================ Single Tag Page Template (Kida-Native) ================================================================================ Displays all posts with a specific tag. KIDA FEATURES USED: - {% let %} for template-scoped variables - Optional chaining (?.) for null-safe access - Null coalescing (??) for smart defaults USAGE: Auto-generated for each tag in the site ================================================================================ #} {% from 'partials/components/article.html' import article_card %} {% from 'partials/navigation-components.html' import pagination %} {% block content %} {# Template-scoped variables #} {% let current_tag = tag ?? '' %} {% let tag_posts = posts ?? [] %} {% let tag_posts_count = tag_posts | length %} {% let total_posts = total_posts ?? tag_posts_count %} {% let total_pages = total_pages ?? 1 %} {% let current_page = current_page ?? 1 %} {% let base_url = base_url ?? tag_url(current_tag) %} {# Two-column layout similar to docs #}
{# Left Sidebar: Tag Navigation #} {# Main Content #}
{# Page Hero - Magazine style #}

# {{ current_tag }}

{{ total_posts | pluralize('post', 'posts') }} tagged with "{{ current_tag }}"

{% if tag_posts | length > 0 %}
{% for post in tag_posts %} {# Skip autodoc pages using efficient function check instead of string manipulation #} {% let is_autodoc = is_autodoc_page(post) if is_autodoc_page is defined else false %} {% unless is_autodoc %} {{ article_card(post, show_excerpt=true) }} {% end %} {% end %}
{# Pagination #} {% if total_pages > 1 %} {{ pagination(current_page, total_pages, base_url) }} {% end %} {% else %}

No posts found with this tag.

{% end %}
{# Right Sidebar: Empty (hidden by CSS) #}
{% end %}