diff --git a/game/cl.html b/game/cl.html index ae35719..3edba1f 100644 --- a/game/cl.html +++ b/game/cl.html @@ -1,34 +1,55 @@ - - - - Changelog - - - - - + fetch(apiUrl) + .then((response) => response.json()) + .then((commits) => { + commits.forEach((commit) => { + const listItem = document.createElement("li"); + const itemText = document.createElement("pre"); + const authorName = commit.commit.author.name; + const commitMessage = commit.commit.message; + const coAuthors = []; + + // Extract co-authors if present + const coAuthorRegex = /Co-authored-by: ([^<]+) <[^>]+>/g; + let match; + while ((match = coAuthorRegex.exec(commitMessage)) !== null) { + coAuthors.push(match[1]); + } + + let allAuthors; + if (coAuthors.length === 1) { + allAuthors = `${authorName} and ${coAuthors[0]}`; + } else if (coAuthors.length > 1) { + allAuthors = `${coAuthors.length + 1} people`; + } else { + allAuthors = authorName; + } + + itemText.innerHTML = `${allAuthors}: `; + itemText.innerText += commitMessage.split("\n")[0]; + + commitList.appendChild(listItem); + listItem.appendChild(itemText); + }); + }) + .catch((error) => { + console.error("Error fetching commits:", error); + }); + }); + + + \ No newline at end of file