{%- import 'macros/getters.html' as get with context -%} {%- macro open(id = None, classes = None) -%} {%- endmacro -%} {%- macro card(title, url, catcolor, escape_title = True, is_url_external = True) -%}
  • {% if escape_title %}{{ title|e }}{% else %}{{ title }}{% endif %}
  • {%- endmacro -%} {%- macro card_from_article_or_page(aop) -%} {%- call(_, sccat, __) get.category_by_name(aop.category.name, True) -%} {{ card(title=aop.title, url=aop.url, catcolor=sccat.color, escape_title=False, is_url_external = False) }} {%- endcall -%} {%- endmacro -%} {%- macro cards_from_articles_or_pages(asops, max = None, standalone = True) -%} {%- if standalone -%} {{ open() }} {%- endif -%} {%- for aop in asops -%} {%- if max == None or loop.index < max -%} {{ cards.card_from_article_or_page(aop) }} {%- endif -%} {%- endfor -%} {%- if standalone -%} {{ close() }} {%- endif -%} {%- endmacro -%}