Skip to content

Instantly share code, notes, and snippets.

@vevgeniy85
Created June 1, 2022 08:25
Show Gist options
  • Save vevgeniy85/d0f16866785cb876992e38f8deda05e1 to your computer and use it in GitHub Desktop.
Save vevgeniy85/d0f16866785cb876992e38f8deda05e1 to your computer and use it in GitHub Desktop.
Shopify - shortcode-readmore
{%- comment -%}
@param before_readmore {Boolean}
Output the contents of the text before the readmore shortcode
{%- endcomment -%}
{%- assign readmore_split = text | split: '<!-- more -->' -%}
{%- if before_readmore -%}{{- readmore_split[0] -}}{%- else -%}{{- readmore_split[1] -}}{%- endif -%}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment