{% if "events" in page.url %} {% set pages = page.collection() %} {% set tag_count = {} %} {% for p in pages %} {% for tag in p.taxonomy.tags %} {% if tag in tag_count %} {% set tag_count = tag_count|merge({ (tag): tag_count[tag] + 1 }) %} {% else %} {% set tag_count = tag_count|merge({ (tag): 1 }) %} {% endif %} {% endfor %} {% endfor %} {% set most_common_tags = tag_count|sort(sort_flags.SORT_REGULAR)|reverse %}