diff --git a/.dockerignore b/.dockerignore index af098af..e4ee886 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,6 +6,7 @@ node_modules .git .gitattributes +.gitea .eslintignore .eslintrc.cjs diff --git a/src/app.html b/src/app.html index a664528..d772768 100644 --- a/src/app.html +++ b/src/app.html @@ -95,6 +95,21 @@ box-shadow: .3em .3em .3em var(--header); } + .container { + padding-top: 3em; + max-width: 90%; + margin: auto; + } + + .cards { + display: flex; + flex-wrap: wrap; + flex-direction: row; + gap: 3em 3em; + padding: 2em 0em 2em 0em; + transition: all 0.2s; + } + @keyframes animationName { 0% { opacity:0; } 50% { opacity:1; } diff --git a/src/lib/api/git.ts b/src/lib/api/git.ts index df39d44..bb44000 100644 --- a/src/lib/api/git.ts +++ b/src/lib/api/git.ts @@ -1,12 +1,12 @@ import type { GitRepo } from "../types"; const API_BASE_URL = "https://git.luke-else.co.uk/api/v1"; -// const ACCESS_TOKEN = import.meta.env.VITE_GITEA_TOKEN; + export async function fetchRepos(): Promise { try { console.log("Fetching repos..."); - const response = await fetch(`${API_BASE_URL}/repos/search`, { + const response = await fetch(`${API_BASE_URL}/repos/search?sort=updated&order=desc&limit=12`, { headers: { // "Authorization": `token ${ACCESS_TOKEN}`, "Content-Type": "application/json" diff --git a/src/lib/types.ts b/src/lib/types.ts index 93b1ebf..881c386 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -1,8 +1,9 @@ export interface GitRepo { - id: number; name: string; - full_name: string; description: string; + language: string; + size: number; + updated_at: Date; html_url: string; private: boolean; fork: boolean; diff --git a/src/main.svelte b/src/main.svelte index 87b57d1..3214fba 100644 --- a/src/main.svelte +++ b/src/main.svelte @@ -61,22 +61,6 @@ font-size: 1.5em; } - /* Skills Cards CSS */ - .container { - padding-top: 3em; - max-width: 90%; - margin: auto; - } - - .cards { - display: flex; - flex-wrap: wrap; - flex-direction: row; - gap: 3em 3em; - padding: 2em 0em 2em 0em; - transition: all 0.2s; - } - {#await getJson('/json/me.json')} diff --git a/src/routes/repos/+page.svelte b/src/routes/repos/+page.svelte index 64e2911..88d0848 100644 --- a/src/routes/repos/+page.svelte +++ b/src/routes/repos/+page.svelte @@ -1,20 +1,35 @@

My Projects

-{#if $repos.length > 0} - -{:else} -

Loading repositories...

-{/if} +
+ {#if $repos.length > 0} +
+ {#each $repos as repo} + +
+

{repo.name}

+ {repo.language} +
+
+

{@html repo.description}

+
+
+ + {repo.name} + {repo.size}KiB + {repo.updated_at} +
+
+ {/each} +
+ {:else} +

Loading repositories...

+ {/if} +