mirror of
https://github.com/placeAtlas/atlas.git
synced 2024-05-29 01:25:10 +02:00
Adjust contributors to not just from Reddit
This commit is contained in:
parent
6eafcefac6
commit
5dca84020e
|
@ -5,17 +5,35 @@
|
||||||
* Licensed under AGPL-3.0 (https://place-atlas.stefanocoding.me/license.txt)
|
* 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')
|
fetch('all-authors.txt')
|
||||||
.then(response => response.text())
|
.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 => {
|
.then(contributors => {
|
||||||
document.querySelector('#reddit-contributors-count').textContent = contributors.length
|
document.querySelector('#contributors-count').textContent = contributors.length
|
||||||
for (const contributor of contributors) {
|
for (const contributor of contributors) {
|
||||||
const userEl = document.createElement('a')
|
const userEl = document.createElement('a')
|
||||||
userEl.href = 'https://reddit.com/user/' + contributor
|
const contributorSplit = contributor.split(':')
|
||||||
userEl.textContent = contributor
|
if (contributorSplit[0] === "gh") {
|
||||||
redditWrapperEl.appendChild(userEl)
|
const contributor1 = contributorSplit[1]
|
||||||
redditWrapperEl.appendChild(document.createTextNode(' '))
|
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>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<h3>Reddit Contributors</h3>
|
<h3>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>
|
<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>
|
<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>
|
</div>
|
||||||
<div class="col-md-5 col-xl-4">
|
<div class="col-md-5 col-xl-4">
|
||||||
|
|
Loading…
Reference in a new issue