Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion generateIndex.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ async function getRepos(url) {
if (!response.ok) throw new Error("Failed to fetch repositories");
const repos = await response.json();
return repos.map(repo => ({
html_url: repo.html_url,
name: repo.name,
full_name: repo.full_name,
owner: repo.full_name.replace(`/${repo.name}`, ''),
owner_url: repo.html_url.replace(`/${repo.name}`, ''),
description: repo.description,
contributors_url: repo.contributors_url,
pushed_at: repo.pushed_at,
Expand Down
20 changes: 14 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,17 @@ <h1 id="page-title">Loading...</h1>
const repoDiv = document.createElement("div");
repoDiv.className = "repo";
repoDiv.innerHTML = `
<h2><a class="repo_title" href="${repo.html_url}" target="_blank">${repo.name}</a></h2>
<p>${repo.description || "No description"}</p>
`;
<div style="display: flex; align-items: center; gap: 8px;">
<h2 style="margin: 0;">
<a class="repo_title" href="${repo.owner_url}" target="_blank" style="text-decoration: none; color: inherit;">${repo.owner}</a>
</h2>
<span>/</span>
<h2 style="margin: 0;">
<a class="repo_title" href="${repo.html_url}" target="_blank" style="text-decoration: none; color: inherit;">${repo.name}</a>
</h2>
</div>
<p>${repo.description || "No description"}</p>
`;

const contributorsDiv = document.createElement("div");
contributorsDiv.className = "contributors";
Expand All @@ -123,9 +131,9 @@ <h2><a class="repo_title" href="${repo.html_url}" target="_blank">${repo.name}</
const contributorDiv = document.createElement("div");
contributorDiv.className = "contributor";
contributorDiv.innerHTML = `
<img src="${contributor.avatar_url}" alt="${contributor.login}" class="avatar">
<a href="${contributor.html_url}" target="_blank">${contributor.login}</a>
`;
<img src="${contributor.avatar_url}" alt="${contributor.login}" class="avatar">
<a href="${contributor.html_url}" target="_blank">${contributor.login}</a>
`;
contributorsDiv.appendChild(contributorDiv);
}
repoDiv.appendChild(contributorsDiv);
Expand Down