Skip to content

Commit

Permalink
fix: Empty contributors list on some pages (#939)
Browse files Browse the repository at this point in the history
  • Loading branch information
kelreel committed Mar 24, 2024
1 parent 99545d6 commit e0d0567
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions docs/.vuepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,22 +86,27 @@ export default defineUserConfig({
window.addEventListener('load', function() {
let contributors = document.querySelectorAll('.contributor');
let contributorArr = Array.from(contributors);
if (!contributorArr.length) {
return;
}
let topFive = contributorArr.slice(0, 5);
topFive.forEach(function(contributor) {
contributor.textContent = contributor.textContent.replace(',', '');
});
let lastComma = contributorArr[4];
lastComma.textContent = lastComma.textContent.replace(',', '');
let updatedList = topFive.map(function(contributor) {
return contributor.textContent;
}).join(', ');
let contributorsDiv = document.querySelector('.contributors');
contributorsDiv.innerHTML = '<span class="label">Contributors: </span>' + updatedList;
});
`,
Expand Down

0 comments on commit e0d0567

Please sign in to comment.