From 9b5fe6014d531aa875280c174314c85de5a9bd26 Mon Sep 17 00:00:00 2001 From: Ricardo Date: Tue, 3 Mar 2026 11:01:05 +0100 Subject: [PATCH] feat: redesign starred page with GitHub Lists tabs, sort, and filters - Add tab bar for GitHub Lists (All, per-list tabs, Uncategorized) - Add sort controls (stars, recently starred, recently updated, name) - Add filter controls (language, star count range, archived toggle) - Add language color dots, formatted star/fork counts, topic overflow - Fix starred count on GitHub activity page (fetch totalCount from API) - All rendering remains client-side via Alpine.js (no build OOM risk) Confab-Link: http://localhost:8080/sessions/b130e9e5-4723-435d-8d5a-fc38113381c9 --- _data/githubStarred.js | 34 +++- starred.njk | 388 ++++++++++++++++++++++++++++++++--------- 2 files changed, 335 insertions(+), 87 deletions(-) diff --git a/_data/githubStarred.js b/_data/githubStarred.js index ababab2..659d181 100644 --- a/_data/githubStarred.js +++ b/_data/githubStarred.js @@ -1,12 +1,32 @@ /** * GitHub Starred Repos Metadata - * Provides build timestamp only — the starred page fetches all data - * client-side via Alpine.js to avoid loading 5000+ objects into - * Eleventy's memory during build (causes OOM on constrained containers). + * Fetches the starred API response (cached 15min) to extract totalCount. + * Only totalCount is passed to Eleventy's data cascade — the full star + * list is discarded after parsing, keeping build memory low. + * The starred page fetches all data client-side via Alpine.js. */ -export default function () { - return { - buildDate: new Date().toISOString(), - }; +import EleventyFetch from "@11ty/eleventy-fetch"; + +const INDIEKIT_URL = process.env.SITE_URL || "https://example.com"; + +export default async function () { + try { + const url = `${INDIEKIT_URL}/githubapi/api/starred/all`; + const response = await EleventyFetch(url, { + duration: "15m", + type: "json", + }); + + return { + totalCount: response.totalCount || 0, + buildDate: new Date().toISOString(), + }; + } catch (error) { + console.log(`[githubStarred] Could not fetch starred count: ${error.message}`); + return { + totalCount: 0, + buildDate: new Date().toISOString(), + }; + } } diff --git a/starred.njk b/starred.njk index 6445691..a179b62 100644 --- a/starred.njk +++ b/starred.njk @@ -34,35 +34,6 @@ eleventyExcludeFromCollections: true

- {# Search box #} - - {# Loading state #} - {# All starred repos — client-side rendered #} + {# Main content — shown after loading #}