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
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…