Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
vikdevelop authored Jun 28, 2024
1 parent e9b2ca4 commit 6a64376
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions wiki/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ <h1>SaveDesktop wiki viewer</h1>
<thead>
<tr>
<th>Page</th>
<th>Last Modified</th>
</tr>
</thead>
<tbody id="folder-list"></tbody>
Expand All @@ -51,6 +50,7 @@ <h1>SaveDesktop wiki viewer</h1>
const githubUser = 'vikdevelop';
const githubRepo = 'SaveDesktop';
const githubBranch = 'webpage';
const githubPagesUrl = `https://${githubUser}.github.io/${githubRepo}/wiki/`;

fetch(`https://api.github.com/repos/${githubUser}/${githubRepo}/contents/wiki?ref=${githubBranch}`)
.then(response => response.json())
Expand All @@ -61,13 +61,10 @@ <h1>SaveDesktop wiki viewer</h1>
if (item.type === 'dir') {
const tr = document.createElement('tr');
const td1 = document.createElement('td');
const td2 = document.createElement('td');

td1.innerHTML = `<span class="directory"><a href="${item.html_url}">${item.name}/</a></span>`;
td2.textContent = item.updated_at;
td1.innerHTML = `<span class="directory"><a href="${githubPagesUrl}${item.name}/">${item.name}/</a></span>`;

tr.appendChild(td1);
tr.appendChild(td2);
folderListElement.appendChild(tr);
}
});
Expand Down

0 comments on commit 6a64376

Please sign in to comment.