{% extends "base.html" %} {% from 'partials/navigation-components.html' import breadcrumbs, section_navigation, pagination with context %} {% from 'partials/content-components.html' import article_card %} {# Chronological Archive Template Used for blog-style sections with dated posts. Displays content in reverse chronological order with pagination. When to use: - Blog posts - News articles - Any time-ordered content Context variables: - section: Section object - posts: List of pages (may be paginated) - subsections: Child sections - total_pages: Total pagination pages (if paginated) - current_page: Current page number (if paginated) #} {% block content %} {{ breadcrumbs(section if section is defined else page) }} {# Section navigation for section pages - dogfooding section properties #} {% if section %} {{ section_navigation(section) }} {% endif %}

{{ title | default(section.title if section else 'Archive') }}

{% if description %}

{{ description }}

{% elif section and section.metadata.get('description') %}

{{ section.metadata.get('description') }}

{% endif %} {% if total_pages %}

Showing {{ posts | length }} of {{ total_posts }} posts {% if current_page > 1 %}(Page {{ current_page }} of {{ total_pages }}){% endif %}

{% endif %}
{% if posts %} {# Show featured posts first - dogfooding where() and where_not() #} {% set featured_posts = posts | where('featured', true) %} {% if featured_posts %} {% endif %} {# Regular posts - dogfooding where_not() #} {% set regular_posts = posts | where_not('featured', true) %} {% if regular_posts %}
{% if featured_posts %}

All Posts

{% endif %}
{% for post in regular_posts %} {{ article_card(post, show_excerpt=True) }} {% endfor %}
{% endif %} {# Pagination #} {% if total_pages and total_pages > 1 %} {{ pagination(current_page, total_pages, base_url) }} {% endif %} {% elif subsections %} {# Show subsections if no direct posts #}

Sections

{% for subsection in subsections %}

{{ subsection.title }}

{% if subsection.metadata.get('description') %}

{{ subsection.metadata.get('description') }}

{% endif %} {% if subsection.pages %}

{{ subsection.pages | length }} page(s)

{% endif %}
{% endfor %}
{% else %}

No posts in this archive yet.

{% if section %}

To add posts:

  • Create a post with a date: content/{{ section.path.relative_to(site.content_dir) }}/my-post.md
  • Add frontmatter with date: 2025-01-01

💡 Posts in this section will be displayed in reverse chronological order.

{% endif %}
{% endif %}
{% endblock %}