short
1
Hi guys,
ranking = [ "luke-bryan/drink-a-beer", "dan-+-shay/10000-hours", "luke-bryan/drink-a-coke", "luke-combs/say-hi..........
{{ range .Site.Data.itunes.ranking }}
What if I want to get for example 10th until 20th, the values from my data ranking file?
Thank you 
short
2
i tried {{ slicestr .Site.Data.itunes.ranking 0 3}}
but no luck 
short
3
{{ range $index, $element := .Site.Data.itunes.ranking }}
{{ if eq $index 1 }}
I think this is it. It returns the second song in the array.
How can I specify 10th to 20th ?
if gt $index 8
and if lt $index 20
?
short
4
{{ if and ( gt $index 8 ) ( lt $index 20 ) }}
this seems working …
system
Closed
5
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.