{%- macro pathtocategory(category) -%} {% set path = "blog/category/" + category %} {{ pathto(path) }} {%- endmacro -%} {%- macro setcolorclass(active) -%} {% if active %} {{ "sd-text-success" }} {% else %} {{ "sd-text-muted" }} {% endif %} {%- endmacro -%} {%- macro category_item(name, active) -%} {{ name }} {%- endmacro -%} {% set post = ablog[pagename] %}

{{ gettext('Categories') }}

{% set i_bool = "intermediate" in post.category|map('string') %} {% set b_bool = "beginner" in post.category|map('string') %} {% set a_bool = "advanced" in post.category|map('string') %}
{{ category_item("beginner", b_bool) }}
{{ category_item("intermediate", i_bool) }}
{{ category_item("advanced", a_bool) }}