Saturday-where_exp, you can do forloop without a loop using where or where_exp filters

jekyll for loop alternative

{% assign my_array = site.static_files | where_exp: “item”, “item.path contains ‘assets/images/target-folder’” %}

or:

{% assign target_folder = “assets/images/target-folder” %} {% assign my_array = site.static_files | where_exp: “item”, “item.path contains target_folder” %}

create an array with push

This {% assign my_array = “” %} creates an empty string. One easy way to create an array in Liquid is to split the above:

{% assign my_array = “” split: ‘,’ %}

Now you can push items into the array inside a for loop in the following way:

{% for image in site.static_files %} {% if image.path contains “assets/images/target-folder” %} {% assign my_array = my_array | push: image %} {% endif %} {% endfor %}

tagcloud variations

Tag Cloud

{% assign tags = site.tags | sort %} {% for tag in tags %} {{ tag[0] | replace:’-‘, ‘ ‘ }} ({{ tag | last | size }}) {% endfor %}

tagcloud implementation with variation

example

The following wiki, pages and posts are tagged with

TitleTypeExcerpt