diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2024-02-08 15:21:20 +0000 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2024-02-08 15:21:20 +0000 |
| commit | f58a1d127577b07bd849df85afd5e574eaec3a35 (patch) | |
| tree | b1174f1717b6f593f187685fda5518d5f056f835 /src/pages/projects.astro | |
| parent | 4cddd911654b77edaa171f775a66fd65491acc30 (diff) | |
| download | personal-website-f58a1d127577b07bd849df85afd5e574eaec3a35.tar.gz personal-website-f58a1d127577b07bd849df85afd5e574eaec3a35.tar.bz2 personal-website-f58a1d127577b07bd849df85afd5e574eaec3a35.zip | |
Turned GitHub projects into a component
Diffstat (limited to 'src/pages/projects.astro')
| -rw-r--r-- | src/pages/projects.astro | 31 |
1 files changed, 5 insertions, 26 deletions
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 = []; -} --- <Page title="Projects" description="Things that I have been working on in the past, and present"> <main> @@ -37,21 +26,11 @@ try { }) } </div> + <!-- + <h2>Andrew Lee GitHub Repositories</h2> + <GitHubProjects client:visible username="Alee14" isOrganization=false />--> <h2>AleeCorp/Alee Productions GitHub Repositories</h2> - { error && <div class="error">{error}</div> } - <div class="grid"> - {repos.map((repo) => { - return ( - <article class="card"> - <h1>{repo.name}</h1> - <p>{repo.description}</p> - <div class="row"> - <a href={repo.html_url} target="_blank">Repository</a> - </div> - </article> - ) - })} - </div> + <GitHubProjects client:visible username="alee14-projects" isOrganization=true /> </main> </Page> <style> |
