From f58a1d127577b07bd849df85afd5e574eaec3a35 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Thu, 8 Feb 2024 15:21:20 +0000 Subject: Turned GitHub projects into a component --- src/pages/projects.astro | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) (limited to 'src/pages') diff --git a/src/pages/projects.astro b/src/pages/projects.astro index 668217c..c6fb19b 100644 --- a/src/pages/projects.astro +++ b/src/pages/projects.astro @@ -2,19 +2,8 @@ import Page from "../layouts/Page.astro"; import projects from "../data/projects.json"; import "../styles/cards.css"; +import GitHubProjects from "../components/GitHubProjects"; -let repos; -let error = null; -try { - const alee14_projects = await fetch('https://api.github.com/orgs/alee14-projects/repos'); - repos = await alee14_projects.json(); - repos = repos.filter(repo => !repo.fork); -} catch (err) { - console.error('Failed to fetch projects:', err); - error = err.message; - // You can set repos to an empty array if the fetch fails - repos = []; -} ---
@@ -37,21 +26,11 @@ try { }) } +

AleeCorp/Alee Productions GitHub Repositories

- { error &&
{error}
} -
- {repos.map((repo) => { - return ( -
-

{repo.name}

-

{repo.description}

- -
- ) - })} -
+