{{ post_title }}
{% if post_desc %}{{ post_desc }}
{% end %}{% extends "base.html" %}
{#
================================================================================
Year Archive Template (Kida-Native)
================================================================================
All posts from a specific year, grouped by month.
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 post card
URL Pattern: /archive/2024/
USAGE:
Create content/archive/2024.md:
---
title: "2024 Archive"
year: "2024"
template: archive-year.html
---
================================================================================
#}
{% from 'partials/navigation-components.html' import breadcrumbs %}
{% from 'partials/components/tags.html' import tag_list %}
{# =============================================================================
POST CARD COMPONENT
============================================================================= #}
{% def archive_post_card(post) %}
{% let post_meta = post?.metadata ?? {} %}
{% let post_title = post?.title ?? 'Untitled' %}
{% let post_href = post?.href ?? '#' %}
{% let post_date = post?.date %}
{% let post_desc = post_meta?.description ?? '' %}
{% let post_author = post_meta?.author ?? '' %}
{% let post_tags = post?.tags ?? [] %}
{% let read_time = post?.reading_time ?? 0 %}
{{ post_desc }}
{{ post_title }}
{% if post_desc %}
{{ year_posts | length }} post{{ 's' if year_posts | length != 1 else '' }} in {{ year }}
{# Optional statistics #} {% if show_stats %} {% let all_content = year_posts |> map(attribute='content') |> join('') %} {% let total_words = all_content | wordcount if all_content else 0 %} {% let all_tags = year_posts |> map(attribute='tags') |> flatten |> unique |> list %} {% let authors = year_posts |> map(attribute='metadata.author') |> select('defined') |> unique |> list %}