-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.js
More file actions
22 lines (22 loc) Β· 1003 Bytes
/
main.js
File metadata and controls
22 lines (22 loc) Β· 1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
fetch('src/data/contributors.json')
.then(response => response.json())
.then(data => {
const contributorsDiv = document.getElementById('contributors');
data.forEach(contributor => {
const contributorElement = document.createElement('div');
let linkedinHtml = '';
if (
contributor.linkedin &&
contributor.linkedin !== 'https://linkedin.com/in/yourlinkedin'
) {
linkedinHtml = `<p>LinkedIn: <a href="${contributor.linkedin}" target="_blank">${contributor.linkedin}</a></p>`;
}
contributorElement.innerHTML = `
<h2>${contributor.name}</h2>
<p>GitHub: <a href="${contributor.github}" target="_blank">${contributor.github}</a></p>
${linkedinHtml}
`;
contributorsDiv.appendChild(contributorElement);
});
})
.catch(error => console.error('Error fetching contributors:', error));