The only way i know to create an array from my liquid template is:
{% assign my_array = "one|two|three" | split: "|" %}
Is there any other way to do it?
Frontmatter
This is a good workaround, add to the top of your file:
---
my_array:
- one
- two
- three
---
then use it as:
{{ page.my_array }}
Analogous for site wide site.data.my_array
on the _config
or under _data/some_file.yml
.
Jekyll 3 update for layouts
If the frontmatter is that of a layout, you need to use:
{{ layout.style }}
instead. See: https://stackoverflow.com/a/37418818/895245