Skip to content

Commit b4bcbe4

Browse files
committed
fix: add community meeting
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
1 parent 09f3100 commit b4bcbe4

6 files changed

Lines changed: 161 additions & 0 deletions

File tree

assets/css/extended/events.css

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,47 @@
1+
/* ── Recurring event info block ──────────────────────────────────────────── */
2+
.recurring-meeting {
3+
display: flex;
4+
flex-direction: column;
5+
gap: 0.6rem;
6+
margin: 1.5rem 0;
7+
padding: 1rem 1.25rem;
8+
border: 1px solid var(--border);
9+
border-radius: 6px;
10+
background: var(--entry);
11+
}
12+
13+
.recurring-meeting-row {
14+
display: flex;
15+
gap: 1rem;
16+
align-items: baseline;
17+
flex-wrap: wrap;
18+
}
19+
20+
.recurring-meeting-label {
21+
flex: 0 0 3.5rem;
22+
font-size: 0.8rem;
23+
font-weight: 700;
24+
text-transform: uppercase;
25+
letter-spacing: 0.05em;
26+
color: var(--secondary);
27+
}
28+
29+
.recurring-badge {
30+
font-size: 0.75rem;
31+
font-weight: 600;
32+
text-transform: uppercase;
33+
letter-spacing: 0.05em;
34+
padding: 0.1rem 0.45rem;
35+
border-radius: 3px;
36+
border: 1px solid var(--border);
37+
color: var(--secondary);
38+
}
39+
40+
.recurring-next {
41+
font-size: 0.85rem;
42+
color: var(--secondary);
43+
}
44+
145
/* ── Schedule / Timeline ─────────────────────────────────────────────────── */
246
.schedule {
347
display: flex;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: "Scikit-build Community Meeting"
3+
description: "Monthly public meeting for the scikit-build ecosystem community"
4+
recurring: true
5+
meet_url: "https://meet.google.com/tgz-umhu-onf"
6+
minutes_url: "https://github.com/orgs/scikit-build/discussions/categories/community-meeting-notes"
7+
weight: 1
8+
---
9+
10+
We have a public Scikit-build community meeting every month! Join us on the third Friday of every month at 12:00 PM ET. Some of our past meeting minutes are [available here](https://github.com/orgs/scikit-build/discussions/categories/community-meeting-notes).

hugo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ baseURL = 'http://localhost'
22
languageCode = 'en-us'
33
title = 'scikit-build'
44
theme = 'github.com/adityatelange/hugo-PaperMod'
5+
buildFuture = true
56

67
[params]
78
description = "Build tools for Python extensions using CMake"

layouts/events/list.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ <h2 class="entry-hint-parent">{{ .Title }}</h2>
1515
<div class="entry-content"><p>{{ . }}</p></div>
1616
{{- end }} {{- if not .Date.IsZero }}
1717
<footer class="entry-footer">{{ .Date.Format "January 2, 2006" }}</footer>
18+
{{- else if .Params.recurring }}
19+
<footer class="entry-footer">
20+
<span class="recurring-badge">Monthly</span>
21+
<span class="recurring-next">Next: <span class="meeting-next"></span></span>
22+
</footer>
23+
{{- end }}
24+
{{- if .Params.recurring }}
25+
<script src="/js/community-meeting.js" defer></script>
1826
{{- end }}
1927
<a
2028
class="entry-link"

layouts/events/single.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,28 @@ <h1 class="post-title">{{ .Title }}</h1>
1212

1313
{{- with .Content }}
1414
<div class="post-content md-content">{{ . }}</div>
15+
{{- end }} {{- with .Params.meet_url }}
16+
<div class="recurring-meeting">
17+
<div class="recurring-meeting-row">
18+
<span class="recurring-meeting-label">When</span>
19+
<span>
20+
Third Friday of every month at
21+
<a href="https://howlonghowmany.com/my-time/eastern-time/12-pm">12:00 PM ET</a>
22+
<span class="meeting-next"></span> your time
23+
</span>
24+
</div>
25+
<div class="recurring-meeting-row">
26+
<span class="recurring-meeting-label">Where</span>
27+
<a href="{{ . }}">Google Meet</a>
28+
</div>
29+
{{- with $.Params.minutes_url }}
30+
<div class="recurring-meeting-row">
31+
<span class="recurring-meeting-label">Notes</span>
32+
<a href="{{ . }}">Past meeting minutes</a>
33+
</div>
34+
{{- end }}
35+
</div>
36+
<script src="/js/community-meeting.js" defer></script>
1537
{{- end }} {{- with .Params.schedule }}
1638
<div class="schedule">
1739
{{- range . }}

static/js/community-meeting.js

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
(function () {
2+
function getThirdFriday(year, month) {
3+
const first = new Date(year, month, 1);
4+
const daysUntilFriday = (5 - first.getDay() + 7) % 7;
5+
return 1 + daysUntilFriday + 14;
6+
}
7+
8+
const nyDateFormat = new Intl.DateTimeFormat("en-US", {
9+
timeZone: "America/New_York",
10+
year: "numeric",
11+
month: "2-digit",
12+
day: "2-digit",
13+
});
14+
15+
const nyOffsetFormat = new Intl.DateTimeFormat("en-US", {
16+
timeZone: "America/New_York",
17+
timeZoneName: "shortOffset",
18+
});
19+
20+
function nyOffsetMinutes(date) {
21+
const offset = nyOffsetFormat
22+
.formatToParts(date)
23+
.find((p) => p.type === "timeZoneName").value;
24+
if (offset === "GMT") return 0;
25+
const match = offset.match(/^GMT([+-])(\d{1,2})(?::?(\d{2}))?$/);
26+
if (!match) throw new Error("Unexpected offset: " + offset);
27+
const sign = match[1] === "+" ? 1 : -1;
28+
return sign * (Number(match[2]) * 60 + Number(match[3] || 0));
29+
}
30+
31+
function newYorkTimeToDate(year, month, day, hour, minute) {
32+
const localAsUTC = Date.UTC(year, month, day, hour, minute, 0);
33+
return new Date(localAsUTC - nyOffsetMinutes(new Date(localAsUTC)) * 60_000);
34+
}
35+
36+
function nextThirdFridayET(hour, minute) {
37+
const now = new Date();
38+
const parts = Object.fromEntries(
39+
nyDateFormat
40+
.formatToParts(now)
41+
.filter((p) => p.type !== "literal")
42+
.map((p) => [p.type, p.value])
43+
);
44+
let year = Number(parts.year);
45+
let month = Number(parts.month) - 1;
46+
47+
function buildMeeting(y, m) {
48+
return newYorkTimeToDate(y, m, getThirdFriday(y, m), hour, minute);
49+
}
50+
51+
let meeting = buildMeeting(year, month);
52+
if (meeting <= now) {
53+
month += 1;
54+
if (month === 12) {
55+
month = 0;
56+
year += 1;
57+
}
58+
meeting = buildMeeting(year, month);
59+
}
60+
return meeting;
61+
}
62+
63+
const els = document.querySelectorAll(".meeting-next");
64+
if (els.length > 0) {
65+
const text = nextThirdFridayET(12, 0).toLocaleString([], {
66+
weekday: "long",
67+
year: "numeric",
68+
month: "long",
69+
day: "numeric",
70+
hour: "numeric",
71+
minute: "2-digit",
72+
timeZoneName: "short",
73+
});
74+
els.forEach((el) => { el.textContent = text; });
75+
}
76+
})();

0 commit comments

Comments
 (0)