{# Post grid component. Expects ``cards`` (sequence of PostCardView mappings) and an optional ``featured_count``. Never reads the ``maatlog`` namespace so that it can be included from any render path. #} {%- set featured = featured_count if featured_count is defined else 0 -%} {%- if cards -%} {%- if featured -%}
{%- for card in cards[:featured] -%} {%- with card=card, card_variant="featured", card_anchor=card.slug -%} {%- include "maatlog/components/post-card.html" -%} {%- endwith -%} {%- endfor -%}
{%- if cards|length > featured -%}

Older posts

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

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

{%- endif -%}