{% extends "base.html" %} {# ================================================================================ Author Single Page Template (Kida-Native) ================================================================================ Displays an individual author's profile with bio, stats, and all their posts. KIDA FEATURES USED: - {% let %} for template-scoped variables - Optional chaining (?.) for null-safe access - Null coalescing (??) for smart defaults - Pipeline operator (|>) for filter chains - {% def %} for reusable card component URL Pattern: /authors/lbliii/ Context variables: - page: Current author page - params.author_name: The author key to look up - site.indexes.author: Author index - site.data.authors: Author registry (if data/authors.yaml exists) ================================================================================ #} {% from 'partials/navigation-components.html' import breadcrumbs %} {% from 'partials/components/tags.html' import tag_list %} {% from 'partials/components/post-card.html' import post_card %} {# ============================================================================= MAIN TEMPLATE ============================================================================= #} {% block content %} {# Template-scoped variables - using AuthorView for normalized access #} {% let author = (page | author_view) ?? none %} {% let section_filter = params?.section_filter ?? '' %} {% let author_index = site?.indexes?.author ?? {} %} {# Get author posts with O(1) lookup #} {% let author_posts_refs = author_index.get(author?.key ?? '') ?? [] %} {% let author_posts = author_posts_refs | resolve_pages %} {# Filter by section if specified #} {% if section_filter %} {% let author_posts = author_posts |> selectattr('_section.name', 'eq', section_filter) |> list %} {% end %} {# Calculate stats #} {% let post_count = author_posts | length %} {% let all_content = author_posts |> map(attribute='content') |> join('') %} {% let total_words = all_content | wordcount if all_content else 0 %} {% let all_tags = author_posts |> map(attribute='tags') |> flatten |> unique |> list %} {% let years = author_posts |> map(attribute='date.year') |> select('defined') |> unique |> sort %} {{ breadcrumbs(page) }}
{% end %}