Skip to content

Commit 6bbbc4f

Browse files
authored
feat: add repositories section with carousel (#159)
Signed-off-by: Mounil <mounilkankhara@gmail.com>
1 parent 24f7b24 commit 6bbbc4f

File tree

8 files changed

+337
-2
lines changed

8 files changed

+337
-2
lines changed

assets/css/main.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,16 @@ nav a.active::after {
160160
@apply max-w-[932px] w-full h-full;
161161
}
162162

163+
/* Repos Swiper - override default swiper styles */
164+
.reposSwiper {
165+
@apply max-w-full;
166+
}
167+
168+
.reposSwiper .swiper-slide {
169+
@apply text-left text-base;
170+
font-family: inherit;
171+
}
172+
163173
.swiper-slide {
164174
@apply font-serif text-center text-lg;
165175
}

content/_index.md

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ section_meet_text = '''
5858
<p>
5959
'''
6060

61+
section_repos_heading = "Jump to our Hiero Repositories"
62+
section_repos_text = '''
63+
Explore some of our most active and widely used Hiero repositories.
64+
These projects form the core of the Hiero ecosystem.
65+
'''
66+
6167
[[section_meet_calls]]
6268
name = "TSC"
6369
description = "The Technical Steering Committee (TSC) meeting for project governance, roadmap planning, and key technical decisions."
@@ -142,6 +148,106 @@ schedule = "Monthly"
142148
calendar_link = "https://zoom-lfx.platform.linuxfoundation.org/meetings/hiero?view=week&occurrence=1763053200"
143149
register_link = "https://zoom-lfx.platform.linuxfoundation.org/meeting/94618152832?password=3b037576-2aab-4f7e-ab24-acf9ca2c3734&invite=true"
144150

151+
[[section_repos]]
152+
name = "hiero-consensus-node"
153+
description = "Crypto, token, consensus, file, and smart contract services for a Hiero based network"
154+
link = "https://github.com/hiero-ledger/hiero-consensus-node"
155+
156+
[[section_repos]]
157+
name = "hiero-local-node"
158+
description = "Run your own local Hiero based network for development purposes"
159+
link = "https://github.com/hiero-ledger/hiero-local-node"
160+
161+
[[section_repos]]
162+
name = "hiero-mirror-node"
163+
description = "Archives data from consensus nodes and serves it via an API"
164+
link = "https://github.com/hiero-ledger/hiero-mirror-node"
165+
166+
[[section_repos]]
167+
name = "hiero-improvement-proposals"
168+
description = "Hiero Improvement Proposal repository for community-driven enhancements"
169+
link = "https://github.com/hiero-ledger/hiero-improvement-proposals"
170+
171+
[[section_repos]]
172+
name = "hiero-sdk-js"
173+
description = "JavaScript/TypeScript SDK for interacting with a Hiero network"
174+
link = "https://github.com/hiero-ledger/hiero-sdk-js"
175+
176+
[[section_repos]]
177+
name = "hiero-sdk-java"
178+
description = "Java SDK for Hiero distributed ledger technology"
179+
link = "https://github.com/hiero-ledger/hiero-sdk-java"
180+
181+
[[section_repos]]
182+
name = "hiero-json-rpc-relay"
183+
description = "Implementation of Ethereum JSON-RPC APIs for Hedera"
184+
link = "https://github.com/hiero-ledger/hiero-json-rpc-relay"
185+
186+
[[section_repos]]
187+
name = "hiero-sdk-go"
188+
description = "Go SDK for Hiero distributed ledger technology"
189+
link = "https://github.com/hiero-ledger/hiero-sdk-go"
190+
191+
[[section_repos]]
192+
name = "hiero-sdk-rust"
193+
description = "The Hiero™ Rust SDK for building on Hiero networks"
194+
link = "https://github.com/hiero-ledger/hiero-sdk-rust"
195+
196+
[[section_repos]]
197+
name = "hiero-mirror-node-explorer"
198+
description = "Hedera Mirror Node Explorer for the Hedera Hashgraph DLT"
199+
link = "https://github.com/hiero-ledger/hiero-mirror-node-explorer"
200+
201+
[[section_repos]]
202+
name = "hiero-cli"
203+
description = "Hiero command line tools for developers"
204+
link = "https://github.com/hiero-ledger/hiero-cli"
205+
206+
[[section_repos]]
207+
name = "solo"
208+
description = "An opinionated CLI tool to deploy and manage standalone test networks"
209+
link = "https://github.com/hiero-ledger/solo"
210+
211+
[[section_repos]]
212+
name = "hiero-block-node"
213+
description = "New Block Node services for Hiero networks"
214+
link = "https://github.com/hiero-ledger/hiero-block-node"
215+
216+
[[section_repos]]
217+
name = "hiero-sdk-tck"
218+
description = "Technology Compatibility Kit used to verify compliant implementations of a Hiero SDK"
219+
link = "https://github.com/hiero-ledger/hiero-sdk-tck"
220+
221+
[[section_repos]]
222+
name = "hiero-sdk-cpp"
223+
description = "A C++ SDK for Hiero: A C++ toolkit for creating and interacting with on-ledger assets"
224+
link = "https://github.com/hiero-ledger/hiero-sdk-cpp"
225+
226+
[[section_repos]]
227+
name = "governance"
228+
description = "Configuration repository for managing all Hiero GitHub repositories"
229+
link = "https://github.com/hiero-ledger/governance"
230+
231+
[[section_repos]]
232+
name = "hiero-sdk-python"
233+
description = "A Python SDK for Hiero: A Python toolkit for interacting with on-ledger assets"
234+
link = "https://github.com/hiero-ledger/hiero-sdk-python"
235+
236+
[[section_repos]]
237+
name = "hiero-sdk-swift"
238+
description = "A Swift SDK for Hiero: A Swift toolkit for creating and interacting with on-ledger assets"
239+
link = "https://github.com/hiero-ledger/hiero-sdk-swift"
240+
241+
[[section_repos]]
242+
name = "sdk-collaboration-hub"
243+
description = "Collaboration hub for SDK-related discussions and coordination"
244+
link = "https://github.com/hiero-ledger/sdk-collaboration-hub"
245+
246+
[[section_repos]]
247+
name = "tsc"
248+
description = "Technical Steering Committee activity, discussions and decisions repository"
249+
link = "https://github.com/hiero-ledger/tsc"
250+
145251
[[section_what_is_hiero_points]]
146252
heading = "Hiero is <strong>fair</strong>"
147253
text = "Everybody should have equal access to all public forums. No one should have the ability to re-prioritize your transactions, or drop them, or front-run, or sandwich trade, or otherwise disadvantage you. The hashgraph algorithm is leaderless. We all deserve a more fair world."

data/repository_stats.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"hiero-consensus-node": {
3+
"stars": 376
4+
},
5+
"hiero-local-node": {
6+
"stars": 272
7+
},
8+
"hiero-mirror-node": {
9+
"stars": 175
10+
},
11+
"hiero-improvement-proposals": {
12+
"stars": 175
13+
},
14+
"hiero-sdk-js": {
15+
"stars": 306
16+
},
17+
"hiero-sdk-java": {
18+
"stars": 249
19+
},
20+
"hiero-json-rpc-relay": {
21+
"stars": 87
22+
},
23+
"hiero-sdk-go": {
24+
"stars": 123
25+
},
26+
"hiero-sdk-rust": {
27+
"stars": 56
28+
},
29+
"hiero-mirror-node-explorer": {
30+
"stars": 46
31+
},
32+
"hiero-cli": {
33+
"stars": 36
34+
},
35+
"solo": {
36+
"stars": 35
37+
},
38+
"hiero-block-node": {
39+
"stars": 33
40+
},
41+
"hiero-sdk-tck": {
42+
"stars": 22
43+
},
44+
"hiero-sdk-cpp": {
45+
"stars": 36
46+
},
47+
"governance": {
48+
"stars": 13
49+
},
50+
"hiero-sdk-python": {
51+
"stars": 47
52+
},
53+
"hiero-sdk-swift": {
54+
"stars": 33
55+
},
56+
"sdk-collaboration-hub": {
57+
"stars": 5
58+
},
59+
"tsc": {
60+
"stars": 5
61+
}
62+
}

hugo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ name = 'Contribute'
3434
url = '/#contribute'
3535
weight = 30
3636

37+
[[menus.main]]
38+
name = 'Repositories'
39+
url = '/#repos'
40+
weight = 35
41+
3742
[[menus.main]]
3843
name = 'Connect'
3944
url = '/#connect'

layouts/_default/home.html

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,101 @@ <h3 class="text-xl sm:text-2xl font-medium mb-3 [&>strong]:text-red">{{ .name |
169169
</div>
170170
</div>
171171
</div>
172+
<div> <!-- divider -->
173+
<div class="container py-[40px] sm:py-0 flex flex-row items-center gap-10">
174+
{{ $graphic := resources.Get "images/Hiero-Icon.svg" }}
175+
{{ with $graphic }}
176+
<img src="{{ $graphic.RelPermalink }}" {{ if $lazyLoading }}loading="lazy"{{ end }}>
177+
{{ end }}
178+
<div class="w-full bg-white-dark h-[1px]"></div>
179+
</div>
180+
</div>
181+
<!-- REPOSITORIES -->
182+
<div id="repos" class="anchor">
183+
<div class="bg-white">
184+
<div class="container pt-[40px] pb-[40px] sm:pt-[60px] sm:pb-[120px]">
185+
<div class="mb-10 sm:mb-16">
186+
<h2 class="text-2xl mb-2.5 sm:text-4xl sm:mb-5">{{ $.Param "section_repos_heading" | safeHTML }}</h2>
187+
<div class="text-lg max-w-full md:max-w-[800px]">{{ $.Param "section_repos_text" | safeHTML }}</div>
188+
</div>
189+
{{ if $.Param "section_repos" }}
190+
<div class="relative w-full px-16">
191+
<div class="swiper reposSwiper">
192+
<div class="swiper-wrapper">
193+
{{ range $.Param "section_repos" }}
194+
<div class="swiper-slide" style="height: auto;">
195+
<div class="border-2 border-white-dark rounded-2xl p-8 hover:border-red transition-colors duration-200 bg-white h-full flex flex-col" data-repo="{{ .name }}">
196+
<h3 class="text-xl sm:text-2xl font-medium mb-3 text-red">{{ .name | safeHTML }}</h3>
197+
{{ if .description }}
198+
<p class="text-base mb-4 text-gray-600 flex-grow">{{ .description | safeHTML }}</p>
199+
{{ end }}
200+
<div class="flex flex-row justify-between items-center mt-4">
201+
{{ if .link }}
202+
<a href="{{ .link }}" target="_blank" rel="noreferrer noopener" class="text-red hover:text-red-dark text-base font-medium underline">
203+
View Repository →
204+
</a>
205+
{{ end }}
206+
{{ $repoStats := index $.Site.Data.repository_stats .name }}
207+
<span class="text-sm text-gray-600">⭐ {{ if $repoStats }}{{ $repoStats.stars }}{{ else }}0{{ end }}</span>
208+
</div>
209+
</div>
210+
</div>
211+
{{ end }}
212+
</div>
213+
<!-- Pagination inside swiper -->
214+
<div class="repos-pagination swiper-pagination !relative !bottom-0 mt-8"></div>
215+
</div>
216+
217+
<!-- Navigation buttons positioned outside swiper but inside relative container -->
218+
<button class="repos-nav-prev absolute top-1/2 left-0 transform -translate-y-1/2 z-10 w-12 h-12 bg-red rounded-full flex items-center justify-center text-white shadow-lg hover:bg-red-dark transition-all duration-200 cursor-pointer">
219+
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
220+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"></path>
221+
</svg>
222+
</button>
223+
<button class="repos-nav-next absolute top-1/2 right-0 transform -translate-y-1/2 z-10 w-12 h-12 bg-red rounded-full flex items-center justify-center text-white shadow-lg hover:bg-red-dark transition-all duration-200 cursor-pointer">
224+
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
225+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path>
226+
</svg>
227+
</button>
228+
</div>
229+
{{ end }}
230+
</div>
231+
</div>
232+
</div>
233+
234+
<!-- Initialize Repos Swiper after HTML is rendered -->
235+
<script>
236+
var reposSwiper = new Swiper(".reposSwiper", {
237+
loop: true,
238+
slidesPerView: 1,
239+
spaceBetween: 24,
240+
grabCursor: true,
241+
pagination: {
242+
el: ".repos-pagination",
243+
clickable: true,
244+
},
245+
breakpoints: {
246+
640: {
247+
slidesPerView: 2,
248+
spaceBetween: 24,
249+
},
250+
1024: {
251+
slidesPerView: 3,
252+
spaceBetween: 32,
253+
},
254+
},
255+
});
256+
257+
// Custom navigation buttons
258+
document.querySelector('.repos-nav-next').addEventListener('click', function() {
259+
reposSwiper.slideNext();
260+
});
261+
262+
document.querySelector('.repos-nav-prev').addEventListener('click', function() {
263+
reposSwiper.slidePrev();
264+
});
265+
</script>
266+
172267
<div> <!-- divider -->
173268
<div class="container py-[40px] sm:py-0 flex flex-row items-center gap-10">
174269
{{ $graphic := resources.Get "images/Hiero-Icon.svg" }}

netlify.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build]
2-
command = "hugo"
2+
command = "npm run fetch-stats && hugo"
33
publish = "public"
44

55
[build.environment]

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"scripts": {
33
"clean": "rm -rf public",
4+
"fetch-stats": "node scripts/fetch-repo-stats.mjs",
45
"start": "TAILWIND_MODE=watch NODE_ENV=development npm-run-all clean prelim:twcss --parallel dev:*",
5-
"build": "NODE_ENV=production npm-run-all clean prelim:twcss prod:*",
6+
"build": "NODE_ENV=production npm-run-all clean fetch-stats prelim:twcss prod:*",
67
"prelim:twcss": "./node_modules/tailwindcss/lib/cli.js -i ./assets/css/main.css -o ./static/css/main.css --jit",
78
"dev:twcssw": "./node_modules/tailwindcss/lib/cli.js -i ./assets/css/main.css -o ./static/css/main.css --jit -w",
89
"dev:hugo": "hugo server",

scripts/fetch-repo-stats.mjs

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/usr/bin/env node
2+
3+
import fs from 'fs';
4+
import path from 'path';
5+
import { fileURLToPath } from 'url';
6+
7+
const __filename = fileURLToPath(import.meta.url);
8+
const __dirname = path.dirname(__filename);
9+
10+
const repos = [
11+
'hiero-consensus-node', 'hiero-local-node', 'hiero-mirror-node',
12+
'hiero-improvement-proposals', 'hiero-sdk-js', 'hiero-sdk-java',
13+
'hiero-json-rpc-relay', 'hiero-sdk-go', 'hiero-sdk-rust',
14+
'hiero-mirror-node-explorer', 'hiero-cli', 'solo', 'hiero-block-node',
15+
'hiero-sdk-tck', 'hiero-sdk-cpp', 'governance', 'hiero-sdk-python',
16+
'hiero-sdk-swift', 'sdk-collaboration-hub', 'tsc'
17+
];
18+
19+
async function fetchRepoStats() {
20+
const stats = new Map(); // Fix: Use Map instead of Object to avoid injection
21+
console.log('📊 Fetching repository statistics...');
22+
23+
for (const repo of repos) {
24+
try {
25+
const response = await fetch(`https://api.github.com/repos/hiero-ledger/${repo}`);
26+
if (response.ok) {
27+
const data = await response.json();
28+
stats.set(repo, { stars: data.stargazers_count }); // Fix: Use Map.set()
29+
console.log(`✓ ${repo}: ${data.stargazers_count} stars`);
30+
} else {
31+
stats.set(repo, { stars: 0 }); // Fix: Use Map.set()
32+
console.log(`✗ ${repo}: API error ${response.status}`);
33+
}
34+
} catch (error) {
35+
stats.set(repo, { stars: 0 }); // Fix: Use Map.set()
36+
console.log(`✗ ${repo}: ${error.message}`);
37+
}
38+
await new Promise(resolve => setTimeout(resolve, 50));
39+
}
40+
41+
const dataDir = path.join(__dirname, '..', 'data');
42+
if (!fs.existsSync(dataDir)) fs.mkdirSync(dataDir, { recursive: true });
43+
44+
// Convert Map to Object for JSON serialization
45+
const statsObj = Object.fromEntries(stats);
46+
47+
fs.writeFileSync(
48+
path.join(dataDir, 'repository_stats.json'),
49+
JSON.stringify(statsObj, null, 2)
50+
);
51+
52+
const totalStars = Array.from(stats.values()).reduce((sum, repo) => sum + repo.stars, 0);
53+
console.log(`🎉 Stats saved! Total stars: ${totalStars.toLocaleString()}`);
54+
}
55+
56+
fetchRepoStats().catch(console.error);

0 commit comments

Comments
 (0)