collections object
All of the store's visible categories.
Look up one category by its slug with collections['slug'] or collections.slug. The result is a category object, or nil.
collections['all'] is a collection of every visible product, unless the store has a category with the slug all. It is also the page at /collections/all.
Looping over collections gives the visible top-level categories, 50 at a time. Use paginate for more. collections.size is the number of visible top-level categories.
liquid
{% assign shoes = collections['shoes'] %}
{% for product in shoes.products limit: 4 %}
{{ product.name }}
{% endfor %}
{% for collection in collections %}
<a href="{{ collection.url }}">{{ collection.title }}</a>
{% endfor %}