I'm trying to access elements from the previous and next arrays. Is this even possible with liquid/Jekyll? I want to access the previous and next url of pages.
This is what I have done so far.
Thanks in advance.
To make sure that that liquid is working on my site I tested by outputting the current page url :
{{venue.url}}
//this line also works
{{page.url}}
and this is how I defied the array which takes the data from a yml file
{% assign page_venue = site.data.venues-array | where: "venueID", page.venue | first %}
This is part of the yml file:
venueID: Red-Radish
name: Red Radish
url: redradish
building: 65
neighborhood: University Union
venueID: Poly-Deli
name: Poly Deli
url: polydeli
building: 19
neighborhood: University Union
venueID: Myrons
name: Myron's
url: myrons
previous: MustangStation
building: 19
neighborhood: University Union
So I'm having trouble outputting something like this(only the current url works):
Current url: polydeli
Previous url: reddish
Next url: myrons
I've the tried the following, but none work:
<p>{{page.next.url}}</p>
<p>{{venue.next.url}}</p>
<p>{{paginate.next.url}}</p>
<p>{{paginator.next_page}}</p>