--- --- Statutes of the Tongue - Manakahthey LIT Ancient Judean
{% assign grammar_pages = site.pages | where_exp: "page", "page.layout == 'grammar_lesson'" | sort: "lesson_number" %} {% comment %} ============================================ MULTI-CATEGORY SUPPORT Build a list of unique categories by splitting comma-separated values ============================================ {% endcomment %} {% assign all_categories = "" %} {% for lesson in grammar_pages %} {% if lesson.category %} {% assign lesson_cats = lesson.category | split: ", " %} {% for cat in lesson_cats %} {% assign trimmed_cat = cat | strip %} {% if all_categories == "" %} {% assign all_categories = trimmed_cat %} {% else %} {% assign all_categories = all_categories | append: "|||" | append: trimmed_cat %} {% endif %} {% endfor %} {% endif %} {% endfor %} {% assign categories_array = all_categories | split: "|||" | uniq | sort %} {% if categories_array.size > 0 %} {% for category in categories_array %}
{{ category }}
{% assign found_lessons = false %} {% for lesson in grammar_pages %} {% if lesson.category contains category %} {% assign found_lessons = true %}

{{ lesson.title }}

{% endif %} {% endfor %} {% unless found_lessons %}

Lessons coming soon

{% endunless %}
{% endfor %} {% else %}
Syntax Tutorials
{% if grammar_pages.size > 0 %} {% for lesson in grammar_pages %}

{{ lesson.title }}

{% endfor %} {% else %}

No syntax tutorials yet. Check back soon!

{% endif %}
{% endif %}