Last active
October 3, 2019 09:37
-
-
Save sshaw/49ff68dacf7e084b951c956a60b9d1b1 to your computer and use it in GitHub Desktop.
"Random" Greeting in a Shopify Liquid Template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% assign name = "sshaw" %} | |
{% assign greetings = "Hi %s!|Oi %s!|¡Hola %s!" | split: "|" %} | |
{% assign index = "now" | date: "%s" | modulo: greetings.size %} | |
{{ greetings[index] | replace_first: '%s', name }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
An interesting implementation!