Skip to content

Instantly share code, notes, and snippets.

View OkayDokayOkay's full-sized avatar

OkayDokay! OkayDokayOkay

View GitHub Profile
@tairli
tairli / tabbed-description.liquid
Last active February 13, 2023 08:04
Tabbed description code for Shopify. "Slice" your description with <H6> elements (which will serve as tab titles) and stop with <H5> element.
{% comment %}
if combine_pretext is false, the text before the first <h6> will be shown above all tabs, otherwise added to the first tab
if stop_on_h5 is true, tabs parsing will stop on first H5 element and the rest will be shown below tabs.
What's inside H5 is discarded, but still put something meneningfull there, just in case you switch theme or alike.
No multiple H5 elements.
{% endcomment %}
{% assign combine_pretext = false %}
{% assign stop_on_h5 = true %}