{% extends "base.html" %} {# Author List Template Displays all authors with their profiles and post counts. Pulls from data/authors.yaml registry and/or content/authors/ pages. URL Pattern: /authors/ Context variables: - page: Current list page (_index.md) - site.data.authors: Author registry (from data/authors.yaml) - site.indexes.author: Author index for post counts #} {% from 'partials/navigation-components.html' import breadcrumbs %} {% block content %} {{ breadcrumbs(page) }}
{# Main content from markdown #} {% if content %}
{{ content | safe }}
{% endif %} {# Build author list from data registry and/or child pages #} {% set authors_list = [] %} {# Add authors from data/authors.yaml #} {% if site.data.authors %} {% for author_key, author_data in site.data.authors.items() %} {% set post_count = (site.indexes.author.get(author_key) | default([])) | length %} {% set _ = authors_list.append({ 'key': author_key, 'name': author_data.name | default(author_key), 'bio': author_data.bio | default(''), 'avatar': author_data.avatar, 'company': author_data.company, 'location': author_data.location, 'github': author_data.github, 'post_count': post_count, 'href': '/authors/' ~ author_key ~ '/' }) %} {% endfor %} {% endif %} {# Add authors from child pages (if not already in registry) #} {% for child in page.children | default([]) %} {% set author_key = child.metadata.get('author_name', child.title) %} {% set existing = authors_list | selectattr('key', 'equalto', author_key) | list %} {% if not existing %} {% set post_count = (site.indexes.author.get(author_key) | default([])) | length %} {% set _ = authors_list.append({ 'key': author_key, 'name': child.title, 'bio': child.metadata.get('bio', ''), 'avatar': child.metadata.get('avatar'), 'company': child.metadata.get('company'), 'location': child.metadata.get('location'), 'github': child.metadata.get('social', {}).get('github'), 'post_count': post_count, 'href': child.href }) %} {% endif %} {% endfor %} {% if authors_list %}
{% for author in authors_list | sort(attribute='name') %}
{% if author.avatar %} {{ author.name }} {% else %}
{{ author.name[0] | upper }}
{% endif %}

{{ author.name }}

{% if author.company or author.location %}

{% if author.company %}{{ author.company }}{% endif %} {% if author.company and author.location %} ยท {% endif %} {% if author.location %}{{ author.location }}{% endif %}

{% endif %} {% if author.bio %}

{{ author.bio | truncate(120) }}

{% endif %}
๐Ÿ“ {{ author.post_count }} post{{ 's' if author.post_count != 1 }} {% if author.github %} ๐Ÿ’ป {{ author.github }} {% endif %}
{% endfor %}
{% else %}

No authors found.

Add authors to data/authors.yaml or create pages in content/authors/.

{% endif %}
{% endblock %}