aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbraxtonhall2022-10-24 04:16:20 +0000
committerbraxtonhall2022-10-24 04:16:20 +0000
commit21d4b1499fbbb5dc6f2c91c7a2e525d0c7a1a599 (patch)
treea57eb91cf0c17bb895babe0568e27a5c2b775b56
parentb29897383d848f93fc175577bf921fbe484badb1 (diff)
Sort entries, use correct URL for people
-rw-r--r--index.html10
1 files changed, 4 insertions, 6 deletions
diff --git a/index.html b/index.html
index 3755c55..9bf65f9 100644
--- a/index.html
+++ b/index.html
@@ -45,11 +45,11 @@
<div id="contributors"></div>
</div>
<script>
- const getContributors = _ => fetch("/people.json").then(res => res.json());
+ const getContributors = _ => fetch(`${window.location.href}/people.json`).then(res => res.json());
const toPersonNode = person => $("<div>", {class: "person"}).append(
toPersonHeader(person),
- ...person.entries.sort(cmpEntry).map(toPersonEntryNode),
+ ...person.entries.sort(cmpName).map(toPersonEntryNode),
);
const toPersonImage = github => github
@@ -77,13 +77,11 @@
}).append($("<code>").text(entry.name)),
);
- const cmpPeople = () => 1; // TODO
-
- const cmpEntry = () => 1; // TODO
+ const cmpName = (a, b) => a.name < b.name ? -1 : 1;
$(document).ready(async _ => {
const contributors = await getContributors()
- .then(people => people.sort(cmpPeople))
+ .then(people => people.sort(cmpName))
.then(people => people.map(toPersonNode))
.then(nodes => $("#contributors").append(...nodes));
console.log(contributors);