mirror of
https://github.com/placeAtlas/atlas.git
synced 2025-01-13 23:54:31 +01:00
Adjust contributors to not just from Reddit
This commit is contained in:
parent
6eafcefac6
commit
5dca84020e
2 changed files with 28 additions and 10 deletions
|
@ -5,17 +5,35 @@
|
|||
* Licensed under AGPL-3.0 (https://place-atlas.stefanocoding.me/license.txt)
|
||||
*/
|
||||
|
||||
const redditWrapperEl = document.querySelector('#reddit-contributors-wrapper')
|
||||
const contributorsEl = document.querySelector('#contributors-wrapper')
|
||||
|
||||
// <i aria-label="GitHub" class="bi bi-github"></i>
|
||||
const gitHubEl = document.createElement("i")
|
||||
gitHubEl.ariaLabel = "GitHub:"
|
||||
gitHubEl.className = "bi bi-github"
|
||||
|
||||
fetch('all-authors.txt')
|
||||
.then(response => response.text())
|
||||
.then(text => text.trim().split('\n').sort())
|
||||
.then(text => text.trim().split('\n').sort((a, b) => {
|
||||
const aSplit = a.split(':')
|
||||
const bSplit = b.split(':')
|
||||
return aSplit[aSplit.length - 1] > bSplit[bSplit.length - 1]
|
||||
}))
|
||||
.then(contributors => {
|
||||
document.querySelector('#reddit-contributors-count').textContent = contributors.length
|
||||
document.querySelector('#contributors-count').textContent = contributors.length
|
||||
for (const contributor of contributors) {
|
||||
const userEl = document.createElement('a')
|
||||
userEl.href = 'https://reddit.com/user/' + contributor
|
||||
userEl.textContent = contributor
|
||||
redditWrapperEl.appendChild(userEl)
|
||||
redditWrapperEl.appendChild(document.createTextNode(' '))
|
||||
const contributorSplit = contributor.split(':')
|
||||
if (contributorSplit[0] === "gh") {
|
||||
const contributor1 = contributorSplit[1]
|
||||
userEl.href = 'https://github.com/' + contributor1
|
||||
userEl.appendChild(gitHubEl.cloneNode())
|
||||
userEl.appendChild(document.createTextNode(' ' + contributor1))
|
||||
} else {
|
||||
userEl.href = 'https://reddit.com/user/' + contributor
|
||||
userEl.textContent = contributor
|
||||
}
|
||||
contributorsEl.appendChild(userEl)
|
||||
contributorsEl.appendChild(document.createTextNode(' '))
|
||||
}
|
||||
})
|
|
@ -180,10 +180,10 @@ <h3>Project Contributors</h3>
|
|||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Reddit Contributors</h3>
|
||||
<p>The 2022 Atlas would not have been possible without the help of our <span id="reddit-contributors-count"></span> Reddit contributors.</p>
|
||||
<h3>Contributors</h3>
|
||||
<p>The 2022 Atlas would not have been possible without the help of our <span id="contributors-count"></span> contributors.</p>
|
||||
<p>Thank you to everyone who submitted new entries, amended existing ones, reported bugs and just supported the project in general.</p>
|
||||
<div id="reddit-contributors-wrapper" style="text-align: justify;"></div>
|
||||
<div id="contributors-wrapper" style="text-align: justify;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5 col-xl-4">
|
||||
|
|
Loading…
Reference in a new issue