Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter/Sort and August Coffee Klatsch #5

Merged
merged 3 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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