Skip to content

Commit

Permalink
Experiment
Browse files Browse the repository at this point in the history
  • Loading branch information
rschu1ze committed Jan 5, 2025
1 parent e3941dc commit c99bf2d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
File renamed without changes.
23 changes: 13 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,21 @@ <h2>Loading...</h2>

const list = document.createElement("ul");
data.forEach((el) => {
const listItem = document.createElement("li");
const anchor = document.createElement("a");
// only show folders that start with a (year) number or contain release
if (/^\d/.test(el.name) || el.name.startsWith("release_")) {
const listItem = document.createElement("li");
const anchor = document.createElement("a");

if (el.type === "file") {
anchor.setAttribute("href", el.download_url);
} else if (el.type === "dir") {
anchor.setAttribute("href", "?path=" + encodeURIComponent(el.path));
}
if (el.type === "file") {
anchor.setAttribute("href", el.download_url);
} else if (el.type === "dir") {
anchor.setAttribute("href", "?path=" + encodeURIComponent(el.path));
}

anchor.textContent = el.name;
listItem.replaceChildren(anchor);
list.appendChild(listItem);
anchor.textContent = el.name;
listItem.replaceChildren(anchor);
list.appendChild(listItem);
}
});
const heading = document.createElement("h2");
const pathEl = document.createElement("code");
Expand Down
1 change: 1 addition & 0 deletions meetup100/moved_to_here

0 comments on commit c99bf2d

Please sign in to comment.