Alphabetical vendor categorization with liquid

The snippet will enable vendor categorization by alphabet letter. 

The idea here is to create a "Brands" page where each vendor is listed under the first letter of its name. This include links to the individual vendor pages. For this we can use the code below:

<ul>
  {% assign current = "" %}
  {% for product_vendor in shop.vendors %}
    {% assign first_letter = product_vendor | strip_html | upcase | truncate: 1, '' %}
    {% unless first_letter == current %}
      <li class="vendor-letter">{{ first_letter }}</li>
    {% endunless %}
    <li>{{ product_vendor | link_to_vendor }}</li>
    {% assign current = first_letter %}
  {% endfor %}
</ul>

We then end up with a simple list which can then be styled into columns if needed.