Skip to content

Commit

Permalink
Merge pull request #5 from SantiagoVillaNeighborhoodAssociation/drjkl…
Browse files Browse the repository at this point in the history
…/upcoming-events

Filter/Sort and August Coffee Klatsch
  • Loading branch information
DrJKL authored Jun 12, 2024
2 parents 19661a8 + afc825e commit d21c133
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
10 changes: 9 additions & 1 deletion data/upcoming_events.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@
date = 2024-06-13T18:30:00
name = "SVNA General Meeting 🌮"

[[event]]
date = 2024-08-03T09:30:00
name = "August Coffee Klatsch ☕"

[[event]]
date = 2024-07-04T16:00:00
name = "July 4th Hotdog Time 🌭"
name = "July 4th Hotdog Time 🌭"

[[event]]
date = 2024-06-01T09:00:00
name = "June Coffee Klatsch ☕"
14 changes: 8 additions & 6 deletions layouts/shortcodes/upcoming_events.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
<section class="px-4 py-2 mt-9 bg-neutral-700">
<h2 class="my-0">Upcoming Events!</h2>
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
{{ range $allEvents }}
<h3 class="mb-1 mt-4 col-span-1 content-end">{{ .name }}</h3>
<span class=" col-span-1 content-end text-right">
{{ .date | time.Format ":date_long" }} at
{{ .date | time.Format ":time_short" }}
</span>
{{ range sort $allEvents ".date" "asc" }}
{{ if ge (time .date).Unix now.Unix }}
<h3 class="mb-1 mt-4 col-span-1 content-end">{{ .name }}</h3>
<span class=" col-span-1 content-end text-right">
{{ .date | time.Format ":date_long" }} at
{{ .date | time.Format ":time_short" }}
</span>
{{ end }}
{{ end }}
</div>
</section>
Expand Down

0 comments on commit d21c133

Please sign in to comment.