From e8241a32c28e0bb4a09080b570eff50e81380e27 Mon Sep 17 00:00:00 2001 From: Carter McBride <18412686+carterworks@users.noreply.github.com> Date: Fri, 23 Aug 2024 14:47:28 -0600 Subject: [PATCH] Do a little formatting --- src/pages/index.astro | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/pages/index.astro b/src/pages/index.astro index 17fdeb5..70a1dfb 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -7,10 +7,9 @@ function isRecent(date: number): boolean { return now - date < sixHours; } +const yazzyUrl = import.meta.env.YAZZY_URL; const feedItems = await getAllFeedItems(); -const recentCount = feedItems.contents.filter((item) => - isRecent(item.pubIsoDate), -).length; + const categories = [ "All", "Recent", @@ -18,9 +17,6 @@ const categories = [ new Set(feedItems.contents.map((item) => item.category)), ).sort(), ]; - -const yazzyUrl = import.meta.env.YAZZY_URL; - const categoryCounts = categories.reduce((acc, category) => { if (category === "All") { acc[category] = feedItems.contents.length; @@ -88,10 +84,12 @@ const pickRandomAccentColor = () => { const index = Math.floor(Math.random() * accentColorsKeys.length); return accentColors[accentColorsKeys[index]]; }; + const categoryColors = categories.reduce((acc, category) => { acc[category] = pickRandomAccentColor(); return acc; }, {}); + const categoriesSelectorCss = categories .filter((c) => c !== "All") .map(