Skip to content

Instantly share code, notes, and snippets.

@camilopayan
Created December 7, 2017 06:58
Show Gist options
  • Save camilopayan/87c2c4de524a020137d4de35b20bbbcb to your computer and use it in GitHub Desktop.
Save camilopayan/87c2c4de524a020137d4de35b20bbbcb to your computer and use it in GitHub Desktop.
I'm trying to get the events whose date is upcoming (after now) and that's failing.
<ul class="event_list">
{{ range (.Data.Pages.ByParam "event_data.date") }}
{{ if isset .Params "event_data" }}
{{ if ge (time (.Param "event_data.date")).Unix now.Unix }}
<li class="grid-margin-x grid-x">
<div class="cell medium-3 date">
<div class="inner_date">{{ dateFormat "Jan 2" (.Param "event_data.date") }}</div>
</div>
<div class="cell auto">
<a href="{{.Permalink}}" class="title h4">{{.Title}}</a>
<p>{{ .Param "event_data.blurb" }}</p>
<p><a href="{{.Permalink}}">[learn more]</a></p>
</div>
</li>
{{ end }}
{{ end }}
{{ end }}
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment