Skip to content

Commit b695434

Browse files
authored
Merge pull request #1 from barnuri/master
sync
2 parents 1bf0971 + b80ea8c commit b695434

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

generateIndex.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@ async function getRepos(url) {
1111
if (!response.ok) throw new Error("Failed to fetch repositories");
1212
const repos = await response.json();
1313
return repos.map(repo => ({
14-
html_url: repo.html_url,
1514
name: repo.name,
15+
full_name: repo.full_name,
16+
owner: repo.full_name.replace(`/${repo.name}`, ''),
17+
owner_url: repo.html_url.replace(`/${repo.name}`, ''),
1618
description: repo.description,
1719
contributors_url: repo.contributors_url,
1820
pushed_at: repo.pushed_at,

index.html

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,17 @@ <h1 id="page-title">Loading...</h1>
111111
const repoDiv = document.createElement("div");
112112
repoDiv.className = "repo";
113113
repoDiv.innerHTML = `
114-
<h2><a class="repo_title" href="${repo.html_url}" target="_blank">${repo.name}</a></h2>
115-
<p>${repo.description || "No description"}</p>
116-
`;
114+
<div style="display: flex; align-items: center; gap: 8px;">
115+
<h2 style="margin: 0;">
116+
<a class="repo_title" href="${repo.owner_url}" target="_blank" style="text-decoration: none; color: inherit;">${repo.owner}</a>
117+
</h2>
118+
<span>/</span>
119+
<h2 style="margin: 0;">
120+
<a class="repo_title" href="${repo.html_url}" target="_blank" style="text-decoration: none; color: inherit;">${repo.name}</a>
121+
</h2>
122+
</div>
123+
<p>${repo.description || "No description"}</p>
124+
`;
117125

118126
const contributorsDiv = document.createElement("div");
119127
contributorsDiv.className = "contributors";
@@ -123,9 +131,9 @@ <h2><a class="repo_title" href="${repo.html_url}" target="_blank">${repo.name}</
123131
const contributorDiv = document.createElement("div");
124132
contributorDiv.className = "contributor";
125133
contributorDiv.innerHTML = `
126-
<img src="${contributor.avatar_url}" alt="${contributor.login}" class="avatar">
127-
<a href="${contributor.html_url}" target="_blank">${contributor.login}</a>
128-
`;
134+
<img src="${contributor.avatar_url}" alt="${contributor.login}" class="avatar">
135+
<a href="${contributor.html_url}" target="_blank">${contributor.login}</a>
136+
`;
129137
contributorsDiv.appendChild(contributorDiv);
130138
}
131139
repoDiv.appendChild(contributorsDiv);

0 commit comments

Comments
 (0)