{% extends "base.html" %} {% from "chirpui/badge.html" import badge %} {% from "chirpui/hero.html" import page_hero %} {% from "chirpui/layout.html" import container, grid, stack %} {% from "chirpui/rendered_content.html" import rendered_content %} {% from "partials/taxonomy-pages.html" import count_label, term_resource_card %} {% from "partials/empty-state.html" import empty_state %} {% block content %} {% let page_title = page?.title ?? "Authors" %} {% let page_desc = page?.description ?? "Browse contributors and their published content." %} {# site.data.authors is "" when no registry data file exists, so guard with `is mapping`. The directory is built from the author CONTENT pages (resolved via the standard fallback chain — page.children was empty in this context), with per-author post counts from the author taxonomy index. #} {% let author_index_raw = site?.indexes?.author %} {% let author_index = author_index_raw if author_index_raw is mapping else {} %} {% let author_pages = posts ?? pages ?? page?.children ?? section?.pages ?? section?.regular_pages ?? [] %} {% let author_items = [] %} {% for child in author_pages %} {% let author_key = child?.metadata?.author_name ?? child?.params?.author_name ?? child?.title ?? '' %} {% set _ = author_items.append({ 'name': child?.title ?? author_key, 'href': child?.href ?? '#', 'bio': child?.metadata?.bio ?? child?.description ?? '', 'post_count': (author_index.get(author_key) ?? []) | length }) %} {% end %} {% let _count = count_label(author_items | length, "author") %}