Skip to content

Commit 955dc6c

Browse files
authored
chore(docs): community section in the main page (#1826)
# Description This PR adds a community section to the directory main page. <img width="3308" height="1834" alt="image" src="https://github.com/user-attachments/assets/3472261d-72b2-41f8-a542-d428b58a828b" /> <img width="2756" height="1754" alt="image" src="https://github.com/user-attachments/assets/d84042e8-09ca-45e7-a0c8-d42c498b3a88" /> ## Type of Change - [ ] Bugfix - [ ] New Feature - [ ] Breaking Change - [ ] Refactor - [x] Documentation - [ ] Other (please describe) ## Checklist - [x] I have read the [contributing guidelines](/agntcy/repo-template/blob/main/CONTRIBUTING.md) - [ ] Existing issues have been referenced (where applicable) - [x] I have verified this change is not present in other open pull requests - [ ] Functionality is documented - [ ] All code style checks pass - [ ] New code contribution is covered by automated tests - [ ] All new and existing tests pass Signed-off-by: Aron Kerekes <arkereke@cisco.com>
1 parent 9cab6d5 commit 955dc6c

7 files changed

Lines changed: 963 additions & 4 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,6 @@ artifacts
149149
docs/mkdocs/site/
150150
docs/mkdocs/.venv/
151151
docs/.task/
152+
153+
# MkDocs GitHub metrics cache (generated at build time)
154+
docs/mkdocs/.cache/

docs/content/index.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ hide:
4848
See SLIM in Action
4949
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"/></svg>
5050
</a>
51+
<a class="slim-hero__btn" href="#community">
52+
Community
53+
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"/></svg>
54+
</a>
5155
<a class="slim-hero__btn" href="https://github.com/agntcy/slim" target="_blank" rel="noopener noreferrer">
5256
GitHub
5357
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 .5C5.73.5.5 5.73.5 12c0 5.08 3.29 9.39 7.86 10.91.58.11.79-.25.79-.56 0-.28-.01-1.02-.02-2-3.2.7-3.88-1.54-3.88-1.54-.53-1.34-1.29-1.7-1.29-1.7-1.05-.72.08-.71.08-.71 1.16.08 1.77 1.19 1.77 1.19 1.03 1.77 2.7 1.26 3.36.96.1-.75.4-1.26.73-1.55-2.55-.29-5.23-1.28-5.23-5.69 0-1.26.45-2.29 1.19-3.1-.12-.29-.52-1.46.11-3.05 0 0 .97-.31 3.18 1.18a11.1 11.1 0 0 1 5.8 0c2.2-1.49 3.17-1.18 3.17-1.18.63 1.59.23 2.76.11 3.05.74.81 1.19 1.84 1.19 3.1 0 4.42-2.69 5.39-5.25 5.68.41.36.78 1.06.78 2.14 0 1.55-.01 2.8-.01 3.18 0 .31.21.68.8.56A11.51 11.51 0 0 0 23.5 12C23.5 5.73 18.27.5 12 .5z"/></svg>
@@ -185,6 +189,104 @@ hide:
185189
</section>
186190
</section>
187191

192+
<section class="slim-community" id="community">
193+
<h2 class="slim-section-title">Community</h2>
194+
<p class="slim-community__lede">
195+
Connect with AGNTCY contributors, join working group meetings, and help shape secure agent messaging.
196+
For more information, see the <a href="community.md">community page</a>.
197+
</p>
198+
199+
<div class="slim-community-social">
200+
<a
201+
class="slim-community-card"
202+
href="https://discord.gg/nbeEENusy"
203+
target="_blank"
204+
rel="noopener noreferrer"
205+
>
206+
<span class="slim-community-card__icon" aria-hidden="true">
207+
<svg viewBox="0 0 24 24" role="img"><path d="M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037 12.3 12.3 0 0 0-.608 1.25 18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z"/></svg>
208+
</span>
209+
<span class="slim-community-card__body">
210+
<span class="slim-community-card__title">Discord</span>
211+
<span class="slim-community-card__text">Chat with maintainers and contributors in the AGNTCY Discord server.</span>
212+
</span>
213+
</a>
214+
215+
<a
216+
class="slim-community-card"
217+
href="https://zoom-lfx.platform.linuxfoundation.org/meetings/agntcy?view=week"
218+
target="_blank"
219+
rel="noopener noreferrer"
220+
>
221+
<span class="slim-community-card__icon" aria-hidden="true">
222+
<svg viewBox="0 0 24 24" role="img"><path d="M19 4h-1V2h-2v2H8V2H6v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 16H5V10h14v10zM5 8V6h14v2H5zm2 4h10v2H7v-2zm0 4h7v2H7v-2z"/></svg>
223+
</span>
224+
<span class="slim-community-card__body">
225+
<span class="slim-community-card__title">Meetings</span>
226+
<span class="slim-community-card__text">Join working group and community meetings on the AGNTCY calendar.</span>
227+
</span>
228+
</a>
229+
230+
<a
231+
class="slim-community-card"
232+
href="https://blogs.agntcy.org/"
233+
target="_blank"
234+
rel="noopener noreferrer"
235+
>
236+
<span class="slim-community-card__icon" aria-hidden="true">
237+
<svg viewBox="0 0 24 24" role="img"><path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zm-5 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"/></svg>
238+
</span>
239+
<span class="slim-community-card__body">
240+
<span class="slim-community-card__title">Blog</span>
241+
<span class="slim-community-card__text">Read announcements, tutorials, and technical deep dives from the SLIM team.</span>
242+
</span>
243+
</a>
244+
</div>
245+
246+
<div class="slim-community-contribute">
247+
<div class="slim-community-contribute__text">
248+
<h3 class="slim-community-contribute__title">Contribute</h3>
249+
<p>
250+
Help build SLIM by contributing code, reporting bugs, or suggesting enhancements. Pick up a
251+
good first issue, review open pull requests, or read the contributing guide to get started.
252+
</p>
253+
<div class="slim-community-contribute__actions">
254+
<a
255+
class="slim-community-contribute__btn"
256+
href="https://github.com/agntcy/slim"
257+
target="_blank"
258+
rel="noopener noreferrer"
259+
>
260+
Visit our GitHub
261+
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 .5C5.73.5.5 5.73.5 12c0 5.08 3.29 9.39 7.86 10.91.58.11.79-.25.79-.56 0-.28-.01-1.02-.02-2-3.2.7-3.88-1.54-3.88-1.54-.53-1.34-1.29-1.7-1.29-1.7-1.05-.72.08-.71.08-.71 1.16.08 1.77 1.19 1.77 1.19 1.03 1.77 2.7 1.26 3.36.96.1-.75.4-1.26.73-1.55-2.55-.29-5.23-1.28-5.23-5.69 0-1.26.45-2.29 1.19-3.1-.12-.29-.52-1.46.11-3.05 0 0 .97-.31 3.18 1.18a11.1 11.1 0 0 1 5.8 0c2.2-1.49 3.17-1.18 3.17-1.18.63 1.59.23 2.76.11 3.05.74.81 1.19 1.84 1.19 3.1 0 4.42-2.69 5.39-5.25 5.68.41.36.78 1.06.78 2.14 0 1.55-.01 2.8-.01 3.18 0 .31.21.68.8.56A11.51 11.51 0 0 0 23.5 12C23.5 5.73 18.27.5 12 .5z"/></svg>
262+
</a>
263+
<a
264+
class="slim-community-contribute__btn slim-community-contribute__btn--highlight"
265+
href="https://github.com/search?q=repo%3Aagntcy%2Fslim+type%3Aissue+label%3A%22good-first-issue%22%2C%22good+first+issue%22&type=issues"
266+
target="_blank"
267+
rel="noopener noreferrer"
268+
>
269+
Good first issues
270+
</a>
271+
</div>
272+
</div>
273+
<div class="slim-community-contribute__metrics">
274+
<a
275+
class="slim-repobeats__link"
276+
href="https://github.com/agntcy/slim/pulse"
277+
target="_blank"
278+
rel="noopener noreferrer"
279+
data-slim-repobeats
280+
data-repo="agntcy/slim"
281+
>
282+
<div class="slim-repobeats" aria-busy="true" aria-label="GitHub repository metrics">
283+
<p class="slim-repobeats__loading">Loading repository metrics…</p>
284+
</div>
285+
</a>
286+
</div>
287+
</div>
288+
</section>
289+
188290
</div>
189291

190292
<section class="slim-get-started" markdown="1">

docs/content/javascripts/slim-repobeats-data.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 228 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,228 @@
1+
/* Copyright AGNTCY Contributors (https://github.com/agntcy) */
2+
/* SPDX-License-Identifier: Apache-2.0 */
3+
4+
/* RepoBeats-style GitHub activity panel (data from slim-repobeats-data.js). */
5+
document$.subscribe(function () {
6+
document.querySelectorAll("[data-slim-repobeats]").forEach(function (root) {
7+
if (root.dataset.slimRepobeatsInit === "true") {
8+
return;
9+
}
10+
root.dataset.slimRepobeatsInit = "true";
11+
12+
var repo = root.dataset.repo || "agntcy/slim";
13+
var panel = root.querySelector(".slim-repobeats");
14+
if (!panel) {
15+
return;
16+
}
17+
18+
var data = window.__SLIM_REPOBEATS_DATA__;
19+
if (!data) {
20+
showRepobeatsError(panel, repo);
21+
return;
22+
}
23+
24+
if (data.embedId) {
25+
panel.innerHTML =
26+
'<img class="slim-repobeats__embed" src="https://repobeats.axiom.co/api/embed/' +
27+
encodeURIComponent(data.embedId) +
28+
'.svg" alt="GitHub repository metrics" decoding="async" loading="lazy" width="814" height="318" />';
29+
panel.removeAttribute("aria-busy");
30+
return;
31+
}
32+
33+
renderRepobeatsPanel(panel, data);
34+
});
35+
});
36+
37+
function showRepobeatsError(panel, repo) {
38+
panel.innerHTML =
39+
'<p class="slim-repobeats__error">Could not load repository metrics. ' +
40+
'<a href="https://github.com/' +
41+
repo +
42+
'/pulse" target="_blank" rel="noopener noreferrer">View activity on GitHub</a>.</p>';
43+
panel.removeAttribute("aria-busy");
44+
}
45+
46+
function renderRepobeatsPanel(panel, data) {
47+
var recentCommits = data.recentCommits;
48+
if (!recentCommits && data.commitBars && data.commitBars.length) {
49+
recentCommits = data.commitBars.slice(-5).reduce(function (sum, value) {
50+
return sum + value;
51+
}, 0);
52+
}
53+
54+
panel.innerHTML =
55+
renderSummaryRow(
56+
"commits",
57+
recentCommits + " Contributions in the Last 30 Days",
58+
data.commitBars || [],
59+
"rgba(236, 72, 153, 1)"
60+
) +
61+
renderSummaryRow(
62+
"prs",
63+
data.openPrs + " Pull Requests Opened",
64+
data.commitBars || [],
65+
"rgba(123, 88, 201, 1)"
66+
) +
67+
'<div class="slim-repobeats__split">' +
68+
renderSplitCard(
69+
"issues",
70+
"Issues",
71+
data.issuesOpened + " opened",
72+
data.issuesClosed + " closed",
73+
data.issueWeeks || [],
74+
"rgba(64, 108, 196, 1)",
75+
"rgba(34, 197, 94, 1)"
76+
) +
77+
renderSplitCard(
78+
"pulls",
79+
"Pull Requests",
80+
data.prsOpened + " opened",
81+
data.prsMerged + " merged",
82+
data.prWeeks || [],
83+
"rgba(123, 88, 201, 1)",
84+
"rgba(34, 197, 94, 1)"
85+
) +
86+
"</div>" +
87+
renderContributors(data.contributors || [], data.repo || "agntcy/slim");
88+
panel.removeAttribute("aria-busy");
89+
}
90+
91+
function renderSummaryRow(kind, title, values, color) {
92+
return (
93+
'<div class="slim-repobeats__row slim-repobeats__row--' +
94+
kind +
95+
'">' +
96+
'<div class="slim-repobeats__row-head">' +
97+
'<span class="slim-repobeats__icon slim-repobeats__icon--' +
98+
kind +
99+
'" style="color:' +
100+
color +
101+
'"></span>' +
102+
'<span class="slim-repobeats__title">' +
103+
escapeHtml(title) +
104+
"</span>" +
105+
"</div>" +
106+
renderBars(values, color) +
107+
"</div>"
108+
);
109+
}
110+
111+
function renderSplitCard(kind, label, opened, closed, values, openColor, closedColor) {
112+
return (
113+
'<div class="slim-repobeats__card slim-repobeats__card--' +
114+
kind +
115+
'">' +
116+
'<div class="slim-repobeats__card-head">' +
117+
'<span class="slim-repobeats__card-label">' +
118+
escapeHtml(label) +
119+
"</span>" +
120+
"</div>" +
121+
'<div class="slim-repobeats__card-stats">' +
122+
'<span class="slim-repobeats__card-stat" style="color:' +
123+
openColor +
124+
'">' +
125+
escapeHtml(opened) +
126+
"</span>" +
127+
'<span class="slim-repobeats__card-stat" style="color:' +
128+
closedColor +
129+
'">' +
130+
escapeHtml(closed) +
131+
"</span>" +
132+
"</div>" +
133+
renderBars(values, openColor, "slim-repobeats__bars--compact") +
134+
"</div>"
135+
);
136+
}
137+
138+
function renderContributors(contributors, repo) {
139+
var maxVisible = 12;
140+
141+
if (!contributors.length) {
142+
return (
143+
'<div class="slim-repobeats__contributors">' +
144+
'<span class="slim-repobeats__contributors-label">Top contributors</span>' +
145+
'<img class="slim-repobeats__contrib" src="https://contrib.rocks/image?repo=' +
146+
encodeURIComponent(repo) +
147+
"&amp;max=" +
148+
maxVisible +
149+
"&amp;columns=" +
150+
maxVisible +
151+
'" alt="Top contributors to ' +
152+
repo +
153+
'" decoding="async" loading="lazy" />' +
154+
"</div>"
155+
);
156+
}
157+
158+
var items = contributors
159+
.slice(0, maxVisible)
160+
.map(function (contributor) {
161+
return (
162+
'<img class="slim-repobeats__avatar" src="' +
163+
escapeHtml(contributor.avatar_url) +
164+
'" alt="' +
165+
escapeHtml(contributor.login) +
166+
'" title="' +
167+
escapeHtml(contributor.login) +
168+
'" loading="lazy" width="32" height="32" />'
169+
);
170+
})
171+
.join("");
172+
173+
return (
174+
'<div class="slim-repobeats__contributors">' +
175+
'<span class="slim-repobeats__contributors-label">Top contributors</span>' +
176+
'<div class="slim-repobeats__contributor-list">' +
177+
items +
178+
"</div>" +
179+
"</div>"
180+
);
181+
}
182+
183+
function renderBars(values, color, extraClass) {
184+
var bars = normalizeBars(values)
185+
.map(function (level) {
186+
return (
187+
'<span class="slim-repobeats__bar" style="--level:' +
188+
level +
189+
";--bar-color:" +
190+
color +
191+
'"></span>'
192+
);
193+
})
194+
.join("");
195+
196+
return (
197+
'<div class="slim-repobeats__bars' +
198+
(extraClass ? " " + extraClass : "") +
199+
'" aria-hidden="true">' +
200+
bars +
201+
"</div>"
202+
);
203+
}
204+
205+
function normalizeBars(values) {
206+
var max = 0;
207+
values.forEach(function (value) {
208+
if (value > max) {
209+
max = value;
210+
}
211+
});
212+
if (!max) {
213+
return values.map(function () {
214+
return 0.08;
215+
});
216+
}
217+
return values.map(function (value) {
218+
return Math.max(0.08, value / max);
219+
});
220+
}
221+
222+
function escapeHtml(value) {
223+
return String(value)
224+
.replace(/&/g, "&amp;")
225+
.replace(/</g, "&lt;")
226+
.replace(/>/g, "&gt;")
227+
.replace(/"/g, "&quot;");
228+
}

0 commit comments

Comments
 (0)