{# Post grid component. Never reads the ``maatlog`` namespace. #} {%- set heading = latest_heading if latest_heading is defined else "Older posts" -%} {%- if featured_cards is defined or latest_cards is defined -%} {%- set featured_list = featured_cards if featured_cards is defined else [] -%} {%- set latest_list = latest_cards if latest_cards is defined else [] -%} {%- if featured_list -%}
{%- for card in featured_list -%} {%- with card=card, card_variant=("lead" if loop.first else "secondary"), card_anchor=card.slug -%} {%- include "maatlog/components/post-card.html" -%} {%- endwith -%} {%- endfor -%}
{%- endif -%} {%- if latest_list -%}

{{ heading|e }}

{%- for card in latest_list -%} {%- with card=card, card_variant="latest", card_anchor=card.slug -%} {%- include "maatlog/components/post-card.html" -%} {%- endwith -%} {%- endfor -%}
{%- endif -%} {%- if not featured_list and not latest_list -%}

No posts yet. Add a document with maatlog metadata to see it listed here.

{%- endif -%} {%- elif cards -%} {%- set featured_n = featured_count if featured_count is defined else 0 -%} {%- if featured_n -%}
{%- for card in cards[:featured_n] -%} {%- with card=card, card_variant="featured", card_anchor=card.slug -%} {%- include "maatlog/components/post-card.html" -%} {%- endwith -%} {%- endfor -%}
{%- if cards|length > featured_n -%}

{{ heading|e }}

{%- endif -%} {%- endif -%} {%- if cards[featured_n:] -%}
{%- for card in cards[featured_n:] -%} {%- with card=card, card_anchor=card.slug -%} {%- include "maatlog/components/post-card.html" -%} {%- endwith -%} {%- endfor -%}
{%- endif -%} {%- else -%}

No posts yet. Add a document with maatlog metadata to see it listed here.

{%- endif -%}