Skip to content

Instantly share code, notes, and snippets.

@joe-dempsey
Created June 8, 2018 10:10
Show Gist options
  • Save joe-dempsey/f6476759879db381ec81b9db9c5b71db to your computer and use it in GitHub Desktop.
Save joe-dempsey/f6476759879db381ec81b9db9c5b71db to your computer and use it in GitHub Desktop.
splitting shopify description
{% assign description_parts = product.description | split: '<!-- split -->' %}
Amount of parts: {{ description_parts.size }}
Index of last part: {% assign index_last = description_parts.size | minus: 1 %}
First part: {{ description_parts.first }}
First part: {{ description_parts[0] }}
Second part: {{ description_parts[1] }}
Third part: {{ description_parts[2] }}
Fourth part: {{ description_parts[3] }}
Last part: {{ description_parts.last }}
Last part: {{ description_parts[index_last] }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment