I have this yaml
param1:
key1: value1
key2: value2
param2:
key1: value1
key2: value2
param3:
key1: value1
key2: value2
how can I get all the keys with a liquid?
The expected result would be
param1,param2,param3
Any idea?
I suggest you an other format for your yml file
- id: param1
key1: value1
key2: value2
- id: param2
key1: value1
key2: value2
- id: param3
key1: value1
key2: value2
Then you could use {{ site.data.file | map: "id" | join: "," }}
Ok, I implemented a small filter to get the hash keys :
https://github.com/MichaelCurrin/jekyll-keys-filter
Just have to write something like:
{{ hash | keys }}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With