Skip to content

Conversation

Mitchina
Copy link
Contributor

@Mitchina Mitchina commented Jul 7, 2025

Description:

This PR implements the event map integration on the homepage as described in issue #2.

Resolves:

What’s included:

  • Leaflet map displaying events from Hugo JSON data.
  • Markers with popups showing event details such as name, date, category, and website.
  • Color-coded markers based on event category for better visual distinction.
  • Map auto-zooms to fit all event markers on load.
  • Added a reset view control for user convenience.
  • list of events fetched from the JSON data that populate the map markers.

Screenshots

Map on Homepage:
Screenshot_2025-07-07_02-27-33
Screenshot_2025-07-07_02-31-54

Copy link
Contributor

@benjaoming benjaoming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WOW! This was quick, really quick! And impressive that it's already up and running 👏 👏

Can we talk a bit today about the event data? I've already taken a lot of other steps, anticipating that it will be managed through /content/events/ - see https://django.github.io/birthday20/events/copenhagen/

(btw totally open to working with direct URLs for events that don't need their own page, but I'd still like to manage their data from /content/events)

{{ $events := (where (.Site.GetPage "/events").Pages.ByDate "published" "!=" "false") }}

<table class="event-table">
{{ $events := .Site.Data.events }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see what you did here!

But the events are supposed to be managed as individual files in /content/events/ - that's how we get the full flexibility. Each event has its own markdown file, but the front matter (the yaml code at the top) has the data in a proper schema.

And no merge conflicts when people are editing the same big JSON soup 😄

background: rgba(255, 255, 255, 0.5);
margin: 1rem;
font-size: 0.8em;
letter-spacing: 0.02em;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only applies to odd rows :)

{{ range sort $events ".fields.date" "asc" }}
{{ $event := .fields }}
<tr>
<td>{{ $event.date }}</td>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to keep some sort of date formatting, so to revert to the previous {{ time.Format "2006-01-01" .Params.event_date }} - see: https://gohugo.io/functions/time/format/

min-height: 350px;
background: var(--color-bg-light);
transition: box-shadow 0.3s;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move this to /assets/sass/style.scss :)

data/events.json Outdated
"address": "molyko to Buea town Road, Buea, Cameroon",
"description": "GMT+1 11am",
"event_type": "in_person",
"event_category": "local_community",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another adjustment is about the event_type and event_category - I think I like that 👍 Can you share a bit about your thinking? Like what categories and types did you have in mind?

<tr>
<td>{{ $event.date }}</td>
<td><a href="{{ $event.website }}" target="_blank">{{ $event.name | truncate 50 }}</a></td>
<td>{{ $event.community }}</td>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it has to be a field named organizer instead? So that mostly, an organizer is a community.. but sometimes people don't really have a name for that, and it's just 2 people 🙂

@benjaoming benjaoming self-assigned this Jul 7, 2025
@benjaoming
Copy link
Contributor

@Mitchina I'll shuffle the data around a bit so the JSON will be auto-generated from entities in content/events/

@benjaoming benjaoming merged commit 543af0d into django:main Jul 7, 2025
1 check passed
@ulgens ulgens mentioned this pull request Jul 11, 2025
@ulgens ulgens linked an issue Jul 11, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Event map integration

2 participants