-
Notifications
You must be signed in to change notification settings - Fork 27
Show upcoming earliest events on the front page. #622
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
Show upcoming earliest events on the front page. #622
Conversation
65ab199 to
8c1be3e
Compare
| <div class="home-events"> | ||
| {{ range first 4 (where .Site.RegularPages "Section" "events" ).ByDate.Reverse }} | ||
| {{ $today := time.AsTime (now.Format "2006-01-02") }} | ||
| {{ range first 4 (where (where .Site.RegularPages "Section" "events") ".Date" "ge" $today).ByDate }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm comparing UTC dates here since we use UTC dates at midnight when defining events.
Example (...Z -> UTC, ...-05:00 -> EST):
website/content/events/2025-2026/2025-09-07-woa-beach-day.md
Lines 3 to 5 in 1b3d167
| title: "Beach Day at Mooney's" | |
| date: 2025-09-07T00:00:01Z | |
| draft: false |
|
LGTM |
|
Current main ordering is latest left to right - can you have that same ordering? |
Do you prefer the later events being on the left? |
ryangchung
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your change works, thanks for contributing!
8e2d706
into
CarletonComputerScienceSociety:master
Before, the furthest out events were being shown on the frontpage. This now shows events on the current day, then upcoming ones.
Time of screenshots: Tue Sep 2, 2025 (url:
https://ccss.carleton.ca/)Before
After