<ul class="upcoming-events">
{{ range where .Data.Pages.ByDate "Section" "events" }}
{{ if ge .Date.Unix now.Unix }}
<li>
<span>{{ .Date.Format "2 January at 3:04pm" }}</span>
— {{ .Title }}
</li>
{{ end }}
{{ end }}
</ul>
However, this excludes events that are happening today. How can this be modified to include the events that are happening today?
You want events that are happening today listed on your site.
That way, people who are coming to the event today have an easy way of finding the event details, location, etc…
And this is another way to do that. This how I solved on the event page list when I wanted to show the event during all of its period (when it has both start and end dates). Can be improved, for sure, but it works.
{{ range .Data.Pages.Reverse }}
{{ $now := now.Format "2006-01-02" }}
{{ $start := .Date.Format "2006-01-02" }}
{{ if .Params.End_date }}
{{ $end := dateFormat "2006-01-02" .Params.End_date }}
{{ if or (ge $start $now) (ge $end $now)}}
{{ partial "event-list.html" . }}
{{ end }}
{{ else if ge $start $now }}
{{ partial "event-list.html" . }}
{{ end }}
{{ end }}
I am upgrading for 0.26 to 0.44 and confused on how to now render a list of upcoming events.
According to this comment by @bep, https://github.com/gohugoio/hugo/issues/3977#issuecomment-379154169 there appears to be associations that can be added to the config.yml, but I am not clear on what those associations are. Also not clear if this will require us to change the front-matter across all of our events.
Is there a place in the docs that talks about how to best render events?